#include<stdio.h>
main()
{int i=1;j=1;
for(;;)
{if(i>5)
break;
else
j+=1;
printf("\n%d",j)
i+=j;
}
}

Answers were Sorted based on User's Feedback



#include<stdio.h> main() {int i=1;j=1; for(;;) {if(i>5) break; else j+=1; printf(..

Answer / jitendra mahajan

2
5

Is This Answer Correct ?    74 Yes 6 No

#include<stdio.h> main() {int i=1;j=1; for(;;) {if(i>5) break; else j+=1; printf(..

Answer / vijay pal

2
5

Is This Answer Correct ?    18 Yes 0 No

#include<stdio.h> main() {int i=1;j=1; for(;;) {if(i>5) break; else j+=1; printf(..

Answer / radha raman

2
3

Is This Answer Correct ?    13 Yes 8 No

#include<stdio.h> main() {int i=1;j=1; for(;;) {if(i>5) break; else j+=1; printf(..

Answer / fa

1
1
1
1
1

Is This Answer Correct ?    1 Yes 4 No

#include<stdio.h> main() {int i=1;j=1; for(;;) {if(i>5) break; else j+=1; printf(..

Answer / sourav basu

1 1

print statement is printing 'j', not 'i'. and the for loop works on the basis of value of 'i'..
tested and verified answer on gcc compiler

Is This Answer Correct ?    2 Yes 5 No

#include<stdio.h> main() {int i=1;j=1; for(;;) {if(i>5) break; else j+=1; printf(..

Answer / vedansh

2
3

Is This Answer Correct ?    2 Yes 6 No

#include<stdio.h> main() {int i=1;j=1; for(;;) {if(i>5) break; else j+=1; printf(..

Answer / ajay

error loop is incomplete

Is This Answer Correct ?    2 Yes 6 No

Post New Answer

More C Interview Questions

what is c

1 Answers  


What is the purpose of void pointer?

0 Answers  


char S; char S[6]= " HELLO"; printf("%s ",S[6]); output of the above program ? (0, ASCII 0, I,unpredictable)

7 Answers   Mascot,


Why main is used in c?

0 Answers  


What is pointers in c with example?

0 Answers  






plz answer.... write a program that reads line (using getline) e.g."345", converts each line to an integer using "atoi" and computes the average of all the numbers read. also compute the standard deviation.

1 Answers  


What would the following code segment printint k = 8;docout << "k = " << k << " ";while k++ < 5; a) 13 b) 5 c) 8 d) pointers

0 Answers  


x=y=z=1 z=++x||++y&&++z Printf("%%%d";xyz) what is the values of x,y and z?????

3 Answers  


There is a mobile keypad with numbers 0-9 and alphabets on it. take input of 7 keys and then form a word from the alphabets present on those keys.

0 Answers  


struct screen_pos{ int row, col } ;move_right(cursor)struct screen_pos *cursor;{ cursor.col++; } /* This statementhas a syntax error */What is the correct statement a) cursor.col = cursor.col + 1; b) col.cursor++; c) *cursor.col++; d) pointer

0 Answers  


Explain built-in function?

0 Answers  


Can I use base-2 constants (something like 0b101010)? Is there a printf format for binary?

0 Answers  


Categories