Pages
About Me
Entertainment
Technologies
Practice Programs
VB Art Gallery
Contact Me
Test - 4
Time left =
What is the output of the following program?
#include<stdio.h>
main(){
int i = 1;
while(++i <= 5)
printf("%d ",i++);
}
1 3 5
2 4
2 4 6
2
What is the output of the below code snippet?
#include<stdio.h> main(){
int a = 5, b = 3, c = 4;
printf("a = %d, b = %d", a, b, c);
}
a=5, b=3
a=5, b=3, c=0
a=5, b=3, 0
compile error
What is the output of the following code snippet?
#include<stdio.h>
main(){
short unsigned int i = 0;
printf("%u", --i);
}
0
-1
65535
32767
What is the output of the following program?
#include<stdio.h>
main(){
char *p = NULL;
printf("%c", *p);
}
NULL
0
Compiler Error
Runtime Error
What is the outpout of the following program?
#include<stdio.h>
main(){
enum { india, is=7, GREAT };
printf("%d %d", india, GREAT);
}
0 1
0 2
0 8
Compiler Error
What is the output of the following program?
#include<stdio.h>
void f(int a[]){
int i;
for(i=0; i<3; i++)
a[i]++;
}
main(){
int i,a[] = {10, 20, 30};
f(a); for(i=0; i<3; ++i)
printf("%d ",a[i]);
}
10 20 30
11 21 31
Compiler Error
Runtime Error
What is the output of the below code snippet?
#include<stdio.h>
main(){
char s[]="hello", t[]="hello";
if(s==t) printf("eqaul strings");
}
equal strings
unequal strings
No output
Compiler Error
What will be the output of the program?
#include<stdio.h>
int main(){
int y=128;
const int x=y;
printf("%d", ++x);
}
128
Garbage value
Error
0
What will be the output of the program?
#include<stdio.h>
int main(){
printf("%d",125/20&&30%5);
}
0
1
Garbage Value
Compile Error
What will be the output of the program?
#include<stdio.h>
int i=0;
int main(){
printf("%d",5+7&&i<<10?12:i*10);
}
Compile Error
Garbage Value
12
0
Submit Test
Newer Post
Older Post
Home