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=~0;
printf("%d",a);
}  
A. 0 B. 1
C. -1 D. none of these

Answer and Explanation

Answer: -1

Explanation:
There is no explanation...

Report Errors

Name:

Loading...

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

void main(){
printf("%d%d%d",-10^9, -10|9, -10&9);
}  
A. 1 1 0 B. 1 0 1
C. -1 0 0 D. -1 -1 0

Answer and Explanation

Answer: -1 -1 0

Explanation:
There is no explanation...

Report Errors

Name:

Loading...

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

void main(){
float a;
a=8.5;
if(a==8.5)
printf("1");
else
printf("2");
}   
A. 1 B. 2
C. error D. none of these

Answer and Explanation

Answer: 1

Explanation:
There is no explanation...

Report Errors

Name:

Loading...

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

void main(){
float a;
a=8.5;
if(a==8.5)
printf("1");
else
printf("2");
}   
A. 3 B. 4
C. 5 D. 6

Answer and Explanation

Answer: 4

Explanation:
There is no explanation...

Report Errors

Name:

Loading...

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

void main(){
int i=10;
printf("%d%d%d",++i, i++, ++i);
}  
A. 11 11 13 B. 13 11 11
C. 11 12 13 D. 13 12 11

Answer and Explanation

Answer: 13 11 11

Explanation:
There is no explanation...

Report Errors

Name:

Loading...

VView Answer | RReport | DDiscuss in Forum
06. 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
07. 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
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 i;
i=1;
i=i+2*i++;
printf("%d",i);
}  
A. 3 B. 4
C. 5 D. 6

Answer and Explanation

Answer: 4

Explanation:
There is no explanation...

Report Errors

Name:

Loading...

VView Answer | RReport | DDiscuss in Forum
10. 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



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