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

#define clrscr() 100 main() { clrscr(); printf("%d\n",clrscr()); }

2 Answers  


To Write a C program to remove the repeated characters in the entered expression or in entered characters(i.e) removing duplicates.

19 Answers   Amazon, BITS, Microsoft, Syncfusion, Synergy, Vector,


Write a Program in 'C' To Insert a Unique Number Only. (Hint: Just Like a Primary Key Numbers In Database.) Please Some One Suggest Me a Better Solution for This question ??

0 Answers   Home,


write a program in c language to get the value of arroy keys pressed and display the message which arrow key is pressed?

1 Answers  


Which version do you prefer of the following two, 1) printf(“%s”,str); // or the more curt one 2) printf(str);

1 Answers  


Write a C program to print look and say sequence? For example if u get the input as 1 then the sequence is 11 21 1211 111221 312211 12112221 .......(it counts the no. of 1s,2s etc which is in successive order) and this sequence is used in run-length encoding.

1 Answers  


{ int *ptr=(int*)malloc(sizeof(int)); *ptr=4; printf("%d",(*ptr)+++*ptr++); }

4 Answers  


main() { float me = 1.1; double you = 1.1; if(me==you) printf("I love U"); else printf("I hate U"); }

1 Answers  


what is brs test reply me email me kashifabbas514@gmail.com

0 Answers  


What is "far" and "near" pointers in "c"...?

3 Answers  


how can i cast a char type array to an int type array

2 Answers  


main() { int i=5,j=10; i=i&=j&&10; printf("%d %d",i,j); }

1 Answers  


Categories