Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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

Why is structure padding done in c?

1192


Explain what are bus errors, memory faults, and core dumps?

1317


How to throw some light on the b tree?

1153


Do you have any idea about the use of "auto" keyword?

1131


Why can’t we compare structures?

1325


A global variable when referred to in another file is declared as this a) local variable b) external variable c) constant d) pointers

1282


How can you pass an array to a function by value?

1178


What are two dimensional arrays alternatively called as?

1245


Why is not a pointer null after calling free?

1074


What is the heap in c?

1125


Can one function call another?

1174


What is the difference between near, far and huge pointers?

1155


C language questions for civil engineering

1766


Why do we use stdio h and conio h?

1136


What is array in c with example?

1359