how many times does the loop iterated ?
for (i=0;i=10;i+=2)
printf("Hi\n");

Answer Posted / vignesh1988i

this will give an warning message .....

it will print the "Hi" infinite times...... since we used
assignment opeartor in the termination condition of the
looping statement....

when i is initilized to 0 first.. again i=10 is been
initilized to 10... so however i is been incremented by 2 or
by n times.... i=10.. which will be an non zero value.... so
it wont come out of the loop.... infered as infinite running.

Is This Answer Correct ?    6 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Can you add pointers together? Why would you?

640


Is c programming hard?

574


Is return a keyword in c?

594


What does the error 'Null Pointer Assignment' mean and what causes this error?

737


Tell me is null always defined as 0(zero)?

666






What are the 5 types of organizational structures?

546


Do pointers take up memory?

652


What is the description for syntax errors?

611


Explain how can I prevent another program from modifying part of a file that I am modifying?

633


Why we use void main in c?

590


What do you mean by scope of a variable in c?

542


Difference between Shallow copy and Deep copy?

1564


What is a MAC Address?

624


can any one tel me wt is the question pattern for NIC exam

1553


Why isn't any of this standardized in c? Any real program has to do some of these things.

621