void main()
{
int a=1;
while(a++<=1)
while(a++<=2);
}

Answers were Sorted based on User's Feedback



void main() { int a=1; while(a++<=1) while(a++<=2); }..

Answer / sabir

this program execute at one both while are working becouse
a++ increase value after while statement that by both are
execute at once

Is This Answer Correct ?    13 Yes 1 No

void main() { int a=1; while(a++<=1) while(a++<=2); }..

Answer / madhavi

1<=1, a=2 (true)(first while)
2<=2,a=3 (true)(second while)
3<=3,a=4 (false)(second while)

4<=1,a=5 (false)(first while)

the loops are in nesting ,the second while is the loop body
of the first while loop

Is This Answer Correct ?    5 Yes 0 No

void main() { int a=1; while(a++<=1) while(a++<=2); }..

Answer / venkatapradeep774

ans:5...i need an explaination for this tat how it will be 5.

Is This Answer Correct ?    2 Yes 1 No

void main() { int a=1; while(a++<=1) while(a++<=2); }..

Answer / dheerendra

it gives error,
because any loop can't be terminated by ';'

Is This Answer Correct ?    0 Yes 3 No

Post New Answer

More C Interview Questions

print the following using nested for loop. 5 4 3 2 1 1 2 3 4 3 2 1 1 2 1 2 1 1 2 3 4 3 2 1 1 2 3 4 5

7 Answers   IBM,


How will you find a duplicate number in a array without negating the nos ?

0 Answers  


Is it possible to execute code even after the program exits the main() function?

0 Answers  


how to go with this?

1 Answers   Wipro,


what is the size of an integer variable?

4 Answers  






consider the following structure: struct num nam{ int no; char name[25]; }; struct num nam n1[]={{12,"Fred"},{15,"Martin"},{8,"Peter"},{11,Nicholas"}}; ..... ..... printf("%d%d",n1[2],no,(*(n1 + 2),no) + 1); What does the above statement print? a.8,9 b.9,9 c.8,8 d.8,unpredictable value

4 Answers   TCS,


what is the role you expect in software industry?

2 Answers   HCL, Wipro,


A C E G H +B D F A I ------------ E F G H D

1 Answers   Infosys,


What is difference between array and pointer in c?

0 Answers  


Write c-code for 5+55+555+5555+55555+555555+5555555. Output will be it's answer...

4 Answers   TCS,


given the piece of code int a[50]; int *pa; pa=a; to access the 6th element of the array which of the following is incorrect? a.*(a+5) b.a[5] c.pa[5] d.*(*pa + 5)

6 Answers   amu, TCS,


1 232 34543 4567654 can anyone tell me how to slove this c question

6 Answers  


Categories