for(i=1;i>0;i++);
printf("i=%d",i);
what will be the answer????

Answer Posted / vignesh1988i

since after the loop there is a semicolon , so according to
the compiler this semicolon will be taken as next line and
the loop will be iterating till the termination condition....


output possibilities :

1)if the variable 'i' which is used as an signed integer
variable , this will take an infinite values and stop at one
instance and it will terminate the application. but wont
display anything in the screen

2) if this is an unsigned variable this will be infinite
with values going on and on without stopping.. but not
displaying it...


conclusion : loop is infinite here.....



thank u

Is This Answer Correct ?    12 Yes 8 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What do mean by network ?

646


Why do we use pointer to pointer in c?

584


what is the different bitween abap and abap-hr?

1734


What is an endless loop?

790


Differentiate between null and void pointers.

620






Write a C++ program to generate 10 integer numbers between - 1000 and 1000, then store the summation of the odd positive numbers in variable call it sum_pos, then find the maximum digit in this variable regardless of its digits length.

1556


What are reserved words?

639


what will be the output for the following main() { printf("hi" "hello"); }

9295


What is typeof in c?

596


I need previous papers of CSC.......plz help out by posting them.......

1809


How many loops are there in c?

569


What is sizeof int in c?

592


How can I display a percentage-done indication that updates itself in place, or show one of those twirling baton progress indicators?

567


Can we declare a function inside a function in c?

571


what type of questions arrive in interview over c programming?

1543