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

2. What is the function of ceil(X) defined in math.h do? A)It returns the value rounded down to the next lower integer B)it returns the value rounded up to the next higher integer C)the Next Higher Value D)the next lower value

3 Answers   Accenture,


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,


What are examples of structures?

0 Answers  


WHO WROTE C LANGUAGE?

4 Answers  


Implement a function that returns the 5th element from the end in a singly linked list of integers in one pass.

11 Answers   Microsoft,






Explain in detail how strset (string handling function works )pls explain it with an example.

1 Answers  


How would you print out the data in a binary tree, level by level, starting at the top?

6 Answers   Amazon, Microsoft,


What is a protocol in c?

0 Answers  


hi , please send me NIC written test papers to sbabavalli@gmail.com

0 Answers   NIC,


Explain how can I pad a string to a known length?

0 Answers  


int array[]={1,2,3,4,5,6,7,8}; #define SIZE (sizeof(array)/sizeof(int)) main() { if(-1<=SIZE) printf("1"); else printf("2"); }

2 Answers   Vector,


If jack lies on Mon, Tue Wed and jill lies on Thursday, Friday and Saturday. If both together tell they lied yesterday. So c the given options and then c cos in the given dates one will be saying the truth and one will be lying. I got Thursday as option because jack is saying the truth he lied yest but jill is lying again as he lies on that day.

0 Answers   TCS,


Categories