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

how can we Declare a variable in c without defining it.

1 Answers   TCS,


What is the return type of sizeof?

0 Answers  


A text file that contains declarations used by a group of functions,programs,or users a) executable file b) header file c) obj file d) .cfile

0 Answers  


accept character from keyboard untill the user presses the enter key.If the user enters any character other than upper case(A-Z)alphabets program should stop taking any input

1 Answers  


Write a programme using structure that create a record of students. The user allow to add a record and delete a record and also show the records in ascending order.

0 Answers   Sikkim Manipal University,






What is function pointer c?

0 Answers  


Given only putchar (no sprintf, itoa, etc.) write a routine putlong that prints out an unsigned long in decimal. [ I gave the obvious solution of taking % 10 and / 10, which gives us the decimal value in reverse order. This requires an array since we need to print it out in the correct order. The interviewer wasn't too pleased and asked me to give a solution which didn't need the array ].

0 Answers  


Q-1: Create a structure to specify data on students given below: Roll number, Name, Department, Course, Year of joining Assume that there are not more than 450 students in the college.

8 Answers  


what is out put of the following code? #include class Base { Base() { cout<<"constructor base"; } ~Base() { cout<<"destructor base"; } } class Derived:public Base { Derived() { cout<<"constructor derived"; } ~Derived() { cout<<"destructor derived"; } } void main() { Base *var=new Derived(); delete var; }

3 Answers   Honeywell,


Explain the use of bit fieild.

0 Answers  


What are the valid places to have keyword “break”?

0 Answers  


In CMM or CMMI certified organizations,we assess only the standard software processes of the organization. We do not assess the organizations other functional departments like HR or Admin. Then how can we certify the entire organization as CMM level company?? We have assessed only software related activities. Right. There is no relation with other departments like Accounts, HR or Admin. Then how can we claim that the whole company is a CMM certified company?

1 Answers   Melstar,


Categories