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 are variables declared in c?
why java is called as a purely oops language.
I have a function which accepts, and is supposed to initialize,a pointer, but the pointer in the caller remains unchanged.
a character or group of characters that defines a register,or a part of storage a) memory b) byte c) address d) linear list
What is the difference between null pointer and void pointer
10 Answers CTS, Manforce, MAQ Software,
i=20,k=0; for(j=1;j<i;j=1+4*(i/j)) { k+=j<10?4:3; } printf("%d", k);
Write a program to print all the prime numbers with in the given range
8 Answers ABC, College School Exams Tests, TCS,
why little endian and big endian came?y they using differently? y they not used commonly ?wt is application of little and big ?
5. distance conversion: Convert a distance from miles to kilometers .there are 5280 feets per mile,12 inches per foot .2.54 centimeters per inch and 100000centimeters per kilometer
2) Write a program that will help Air Traffic Control for an airport to view the sequence of flights ready for take-off. The airport can accommodate 10 flights waiting for take-off at any point in time. Each flight has a unique 3 digit numeric identifier.  Each time a flight takes-off, Air Traffic Control adds a flight to the waitlist. Each time a flight is added to the waitlist, the list of flights waiting to take-off must be displayed.  When a flight is cleared for take-off, Air Traffic Control removes the flight from the waitlist. Each time a flight takes-off, the list of flights waiting to take-off must be displayed.  Sequence of take-off is the sequence of addition to the waitlist
how is the examination pattern?
how to add numbers without using arithmetic operators.