please give code for this 1 2 4 7 11 16

Answers were Sorted based on User's Feedback



please give code for this 1 2 4 7 11 16..

Answer / yogesh sharma

Try this.

#include<stdio.h>
void main()
{
int a=1,b,i=0;
while(i<=5)
{
a=a+i;
printf("%d \n",a);
i++;
}
getch();
}

Is This Answer Correct ?    97 Yes 50 No

please give code for this 1 2 4 7 11 16..

Answer / kiran

#include<stdio.h>
#include<conio.h>
void main()
{
int p=1;
for(int i=1;i<=5;i++)
{
printf("%d ",p);
p+=i;
}
getch();
}

Is This Answer Correct ?    34 Yes 21 No

please give code for this 1 2 4 7 11 16..

Answer / ashis 6

#include<studio.h>
#include<conio.h>
Void main()
{
Int x,y;
Y=0;
For(x=1;x<=6;x++)
{
Printf("%d",y);
Y=x+y
}

Is This Answer Correct ?    8 Yes 4 No

please give code for this 1 2 4 7 11 16..

Answer / sai

#include<stdio.h>
#include<conio.h>
void main()
{
int s=1,i,n;
printf("enter a number
");
scanf("%d",&n);
for(i=0;i<=n;i++)
{
s=s+i;
printf("%3d",s);
}
getch;
}

Is This Answer Correct ?    0 Yes 0 No

please give code for this 1 2 4 7 11 16..

Answer / sai

sk rider

Is This Answer Correct ?    0 Yes 1 No

please give code for this 1 2 4 7 11 16..

Answer / santhoshreddy katam

#include<stdio.h>
#include<conio.h>
void main()
{
int a=1;
for(int i=0;i<=5;i++)
{
a=a+i;
printf("%d/n", a);
getch();
}
}

Is This Answer Correct ?    36 Yes 40 No

please give code for this 1 2 4 7 11 16..

Answer / ashish tiwari

#include<stdio.h>
#include<conio.h>
void main()
{
int p=1,i;
for(i=1;i<=6;i++)
{
printf("%d ",p);
p+=i;
}
getch();
}

Is This Answer Correct ?    4 Yes 8 No

please give code for this 1 2 4 7 11 16..

Answer / aditya

#include<stdio.h>
int main()
{
int fir=1,nex=0;
for(nex=0;nex<6;nex++)
{fir=fir+nex;
printf("%d ",fir);

}}

Is This Answer Correct ?    3 Yes 8 No

please give code for this 1 2 4 7 11 16..

Answer / guest

1 10 100 111 1011 1111

Is This Answer Correct ?    6 Yes 12 No

please give code for this 1 2 4 7 11 16..

Answer / mohan

#include<stdio.h>
void main(){
int i,j=1;
printf("%d\t",j);
for(i=1;i<6;i++){
j=j+i;
printf("%d\t",j);
}
}

Is This Answer Correct ?    6 Yes 13 No

Post New Answer

More C Interview Questions

how to write a data 10 in address location 0x2000

3 Answers  


What is this pointer in c plus plus?

0 Answers  


what is the use of ~ in c lang?????

3 Answers  


Will Macros support multiple arguments ?

7 Answers   Oracle,


what is the difference between definition and declaration? give me some examples.

2 Answers   TCS,






with out using main how to execute the program?

2 Answers  


O,T,T,F,F,S,S,E,N,?,?,?,T,F,F,S,S,E,N

9 Answers   ADP,


What are global variables and how do you declare them?

0 Answers  


Explain what are bus errors, memory faults, and core dumps?

0 Answers  


what is the meaning of java that is (J A V A) full form of JAVA

71 Answers   AKS University, Bhel, BNL, BPO, HCL, Peacecon,


What is the difference between a free-standing and a hosted environment?

0 Answers   Aspire,


typedef enum { html, java, javascript, perl, cgi } lang;The above statement defines a : a) Union b) User defined type c) Enumerated variable d) none

0 Answers  


Categories