#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

4) Write a program that takes a 5 digit number and calculates 2 power that number and prints it.

5 Answers  


What is array within structure?

0 Answers  


Who is the main contributor in designing the c language after dennis ritchie?

0 Answers  


#include <stdio.h> int main() { int i; for (i=0;i<3;++i) { fork();fork(); } } How many processes are created when running this program (including the initial one)? Explain &#1567;&#1567;&#1567;

4 Answers  


write a c program to find reminder and quotient if one number is divided by other.to code this program don't use more than 2 variables

2 Answers   TCS,






When was c language developed?

0 Answers  


What is logical error?

0 Answers  


What is data structure in c and its types?

0 Answers  


wat is the meaning of c?

9 Answers   CTS, IBM, Wipro,


What are the advantages of the functions?

0 Answers  


What is a volatile keyword in c?

0 Answers  


Is main is a keyword in c?

0 Answers  


Categories