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

Answers were Sorted based on User's Feedback



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

Answer / ani

infinite loop, bcoz there is no condition to break the loop.

Is This Answer Correct ?    16 Yes 3 No

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

Answer / guest

infinite coz there is no condition to stop it

Is This Answer Correct ?    11 Yes 4 No

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

Answer / guest

Infinite

Is This Answer Correct ?    7 Yes 3 No

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

Answer / 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

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

Answer / pradeep

infinite loop becouse ther is no condition given there.
absence of condition it will be printing hi infinite time

Is This Answer Correct ?    5 Yes 2 No

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

Answer / rahul

infinite times

Is This Answer Correct ?    4 Yes 3 No

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

Answer / altaf khan

it will give an error becoz in place of condition it is given a statement which does not returns boolean value

Is This Answer Correct ?    1 Yes 1 No

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

Answer / sai

It doesn't has condition in the loop to move on, and here i
is of type what?, not mentioned.
This loop doesn't executes with this condition, it should
be told i<= or i>= depending on the requirement.

Is This Answer Correct ?    1 Yes 1 No

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

Answer / viji

It will give a warning message........

Is This Answer Correct ?    1 Yes 9 No

Post New Answer

More C Interview Questions

PROGRAM TO WRITE CONTENTS OF 1 FILE IN REVERSE TO ANOTHER FILE,PROGRAM TO COPY 1 FILE TO ANOTHER BY SPECIFYING FILE NAMES AS COMMAND LINE

0 Answers  


can please someone teach me how to create this program using while statement.. this is the output should look like 0 2 4 6 8 10 -thanks.. :) need it asap...

7 Answers  


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

0 Answers  


How to avoid structure padding in C?

8 Answers   Tech Mahindra,


Is null equal to 0 in sql?

0 Answers  






Given an array of characters, how would you reverse it? How would you reverse it without using indexing in the array?

1 Answers   Microsoft,


What is the incorrect operator form following list(== , <> , >= , <=) and what is the reason for the answer?

0 Answers  


how to find greatet of 10 numbers without using array?

4 Answers  


How can you avoid including a header more than once?

0 Answers  


How can I split up a string into whitespace-separated fields?

0 Answers  


Write a program to display all the prime nos from 1 to 1000000, your code should not take time more than a minute to display all the nos.

0 Answers  


Write any data structure program (stack implementation)

1 Answers   HTC,


Categories