Welcome Guest | Sign in | Register

Home > C Programming > Operators > Questions and Answers

01. 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
02. What is the output of the following program?

void main(){
int a,b;
a=b=10;
while(a)
{
a=b++<=13;
printf("%d%d",a,b);
}
printf("%d%d",a+10,b+10);
}  
A. 1 11 1 12 1 13 1 14 0 15 a=10 b=25 B. 0 11 1 12 1 13 1 14 0 15 a=10 b=25
C. 1 11 1 12 1 13 1 14 0 15 a=11 b=25 D. 0 11 1 12 1 13 1 14 0 15 a=10 b=25

Answer and Explanation

Answer: 1 11 1 12 1 13 1 14 0 15 a=10 b=25

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(){
printf("%d%d",47%5,47%-5);
printf("%d%d%d",-47%5,-47%-5,5%7);
}  
A. 2,-2,-2,-2,5 B. 2,2,-2,-2,5
C. 2,-2,2,-2,5 D. 2,2,-2,-2,0

Answer and Explanation

Answer: 2,2,-2,-2,5

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 13 14 14 B. 11 12 14 15 15
C. 12 13 15 16 16 D. 11 12 13 14 14

Answer and Explanation

Answer: 12 13 15 16 16

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.