Write a program that produces these three columns sequence nos. using loop statement
Sequence nos. Squared Squared + 5
1 1 6
2 4 9
3 9 14
4 16 21
5 25 30



Write a program that produces these three columns sequence nos. using loop statement Sequence nos. ..

Answer / ram

main()
{
int i,j,n=1;
for(i=1;i<6;i++)
{
n=i;
for(j=1;j<4;j++)
{


if(j==2)
n=n*n;
if(j==3)
n=n+5;
printf("%d ",n);
}
printf("
");
}
}

Is This Answer Correct ?    1 Yes 0 No

Post New Answer

More C Code Interview Questions

main() { int i=5; printf("%d%d%d%d%d%d",i++,i--,++i,--i,i); }

7 Answers  


void ( * abc( int, void ( *def) () ) ) ();

1 Answers  


void pascal f(int i,int j,int k) { printf(“%d %d %d”,i, j, k); } void cdecl f(int i,int j,int k) { printf(“%d %d %d”,i, j, k); } main() { int i=10; f(i++,i++,i++); printf(" %d\n",i); i=10; f(i++,i++,i++); printf(" %d",i); }

1 Answers  


What is the output for the program given below typedef enum errorType{warning, error, exception,}error; main() { error g1; g1=1; printf("%d",g1); }

1 Answers  


Hi, i have a project that the teacher want a pyramid of numbers in C# or java...when we click a button...the pyramid should be generated in a listbox/or JtextArea...and the pyramid should have the folowing form: 1 232 34543 4567654 567898765 67890109876 7890123210987 890123454321098 90123456765432109 0123456789876543210 Plz help with codes...didn't find anything on the net.

0 Answers  






There were 10 records stored in “somefile.dat” but the following program printed 11 names. What went wrong? void main() { struct student { char name[30], rollno[6]; }stud; FILE *fp = fopen(“somefile.dat”,”r”); while(!feof(fp)) { fread(&stud, sizeof(stud), 1 , fp); puts(stud.name); } }

1 Answers  


why the range of an unsigned integer is double almost than the signed integer.

1 Answers  


write a program in c to merge two array

2 Answers  


main() { int x=5; clrscr(); for(;x==0;x--) { printf("x=%d\n”", x--); } } a. 4, 3, 2, 1, 0 b. 1, 2, 3, 4, 5 c. 0, 1, 2, 3, 4 d. none of the above

3 Answers   HCL,


main() { int i=5; printf(“%d”,i=++i ==6); }

1 Answers  


hello sir,is there any function in C that can calculate number of digits in an int type variable,suppose:int a=123; 3 digits in a.what ll b answer?

6 Answers  


write a program to Insert in a sorted list

4 Answers   Microsoft,


Categories