please give code for this 1 2 4 7 11 16
Answers were Sorted based on User's Feedback
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 |
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 |
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 |
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 |
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 |
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 |
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 |
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 |
how to write a data 10 in address location 0x2000
What is this pointer in c plus plus?
what is the use of ~ in c lang?????
Will Macros support multiple arguments ?
what is the difference between definition and declaration? give me some examples.
with out using main how to execute the program?
O,T,T,F,F,S,S,E,N,?,?,?,T,F,F,S,S,E,N
What are global variables and how do you declare them?
Explain what are bus errors, memory faults, and core dumps?
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?
typedef enum { html, java, javascript, perl, cgi } lang;The above statement defines a : a) Union b) User defined type c) Enumerated variable d) none