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 is data structure in c programming?

574


what does static variable mean?

657


What is extern storage class in c?

513


Given a valid 24 hour format time find the combination of the value and write a program ,do not hard the value and if any other inputs provided should work with the logic implemented Input: 11:30 Output: 13:10 Input: 18:25 Output: 21:58

1122


Write a program on swapping (100, 50)

638






How does struct work in c?

611


What are inbuilt functions in c?

560


How can you invoke another program from within a C program?

618


the number of measuring units from a arbitrary starting point in a record area or control block to some other point a) branching b) recording pointer c) none d) offset

640


How can you determine the maximum value that a numeric variable can hold?

641


Is register a keyword in c?

638


What is the difference between new and malloc functions?

581


What is a null string in c?

589


How many bytes are occupied by near, far and huge pointers (dos)?

675


Calculate 1*2*3*____*n using recursive function??

1519