C Programming Sample Question Paper: Multiple Choice (Only ONE Choice Is The RIGHT Answer For Each Question Below)
C Programming Sample Question Paper: Multiple Choice (Only ONE Choice Is The RIGHT Answer For Each Question Below)
Multiple Choice (Only ONE choice is the RIGHT answer for each question below)
main(){printf(“Hello World”);};;;
1. Yes
2. No
1. 11 … 13
2. 12 … 13
3. Error
Page 1 of 5
4. None of the above
} aaa;
char x;
};
union bbb pqr;
printf(“%d” , pqr.x);
}
1. 1
2. -1
3. 0
4. Compilation error
abc()
{
return 10;
return 100;
}
1. 10
2. 10 10
3. 10…10
4. None of the above
1. 12
2. 11
3. 01
4. None of the above
Page 3 of 5
11. What is the output of the following program
main()
{
int a[5];
3[a] = 10;
printf(“%d”, *(a+3));
}
1. Compilation Error
2. Runtime Error
3. 10
4. None of the above
12. What is the output of the following program (when run under turbo C)
main()
{
char *p = “aygm”;
char c;
c = ++*p++;
printf(“%c”,c);
}
1. agym
2. bygm
3. b
4. gmay
13. What is the output of the following program (when run under turbo C)
main()
{
char *p = “ABCDEF”;
printf(“%d”, -++*p);
}
1. Comilation error
2. B
3. 66
4. –66
void main(void)
{
int i;
for(i=0;i++;i<100)
printf(“%d”, i);
}
1. 0
2. 1
3. Compile time error
4. No output
#define a 10
void main(void)
{
#define a 10
printf("%d");
}
1. 100
2. some random number
3. 2367460
4. 0
void clrscr();
int i=10;
void main(void)
{
clrscr();
}
void clrscr()
{
printf(“%d”,i);
}
1. no output is displayed
2. compilation error: cannot use the keyword ‘clrscr’ as a function name
3. displays 10.
4. None of the above
Page 5 of 5