Welcome Guest | Sign in | Register

Home > C Programming > Operators > Questions and Answers

01. What is the output of following program?
void main(){
int a;
a=10;
a*=10+2;
printf("%d",a);
}  
A. 102 B. 100
C. 120 D. 22

Answer and Explanation

Answer: 120

Explanation:
There is no explanation...

Report Errors

Name:

Loading...

VView Answer | RReport | DDiscuss in Forum
02. What is the output of the following program?
void main(){
int a;
a=1;
a++ * ++a;
printf("%d",a);
}   
A. 3 B. 4
C. 6 D. 2

Answer and Explanation

Answer: 3

Explanation:
There is no explanation...

Report Errors

Name:

Loading...

VView Answer | RReport | DDiscuss in Forum
03. What is the output of the following program?
void main(){
int a,b;
a=b=1;
a=a++ + ++b;
b=b++ + ++a;
printf("%d%d",a,b);
}   
A. 4 7 B. 5 7
C. 4 8 D. 5 8

Answer and Explanation

Answer: 5 8

Explanation:
There is no explanation...

Report Errors

Name:

Loading...

VView Answer | RReport | DDiscuss in Forum
04. What is the output of the following program?
void xyz(int p1, int *p2){
++p1;
++*p2;
printf("%d%d",p1,*p2);
}
void main(){
int a=10;
xyz(a++,&a);
xyz(a++,&a);
printf("%d",a);
}  
A. 10 11 12 13 13 B. 11 12 13 13 14
C. 10 11 12 12 13 D. 11 12 13 14 14

Answer and Explanation

Answer: 11 12 13 14 14

Explanation:
There is no explanation...

Report Errors

Name:

Loading...

VView Answer | RReport | DDiscuss in Forum
05. What is the output of following program?
void f1(){
int a=0;
++a;
printf("%d",a);
}
main(){
int a=10;
f1();
f1();
f1();
printf("%d",a);
return 0;
}  
A. 0 1 1 10 B. 10 0 1 10
C. 1 2 3 4 D. 1 1 1 10

Answer and Explanation

Answer: 1 1 1 10

Explanation:
There is no explanation...

Report Errors

Name:

Loading...

VView Answer | RReport | DDiscuss in Forum
06. What is the output of following program?
void main(){
printf("%d%d%d",10<<1, 10>>1, ~10);
printf("%d%d%d",10^20, 10|20, 10&20);
}  
A. 20 5 -11 30 30 1 B. 20 5 -9 30 30 0
C. 5 20 -11 30 30 0 D. 20 5 -11 30 30 0

Answer and Explanation

Answer: 20 5 -11 30 30 0

Explanation:
There is no explanation...

Report Errors

Name:

Loading...

VView Answer | RReport | DDiscuss in Forum
07.  What is the output of following program?
void main(){
int a=1;
a=a<<15;
printf("%d",a);

A. 32767 B. -32767
C. 32768 D. -32768

Answer and Explanation

Answer: -32768

Explanation:
There is no explanation...

Report Errors

Name:

Loading...

VView Answer | RReport | DDiscuss in Forum
08. What is the output of following program?
void main(){
int a;
a=453<<16;
printf("%d",a);

A. 0 B. 1
C. -1 D. none of these

Answer and Explanation

Answer: 0

Explanation:
There is no explanation...

Report Errors

Name:

Loading...

VView Answer | RReport | DDiscuss in Forum
09. What is the output of following program?
void main(){
int a;
a=453>>16;
printf("%d",a);

A. 0 B. 1
C. -1 D. none of these

Answer and Explanation

Answer: 0

Explanation:
There is no explanation...

Report Errors

Name:

Loading...

VView Answer | RReport | DDiscuss in Forum
10. What is the output of following program?

void abc(int a){
++a;
printf("%d",a);
}
void main(){
int a=10;
abc(++a);
abc(a++);
printf("%d",a);

A. 11 12 12 B. 11 12 13
C. 12 12 12 D. 12 12 13

Answer and Explanation

Answer: 12 12 12

Explanation:
There is no explanation...

Report Errors

Name:

Loading...

VView Answer | RReport | DDiscuss in Forum



Partner Sites
LucentBlackBoard.com                  SoftLucent.com                  LucentJobs.com
All rights reserved © 2012-2015 SoftLucent.