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 are variables declared in c?

0 Answers  


why java is called as a purely oops language.

3 Answers   TVS,


I have a function which accepts, and is supposed to initialize,a pointer, but the pointer in the caller remains unchanged.

1 Answers  


a character or group of characters that defines a register,or a part of storage a) memory b) byte c) address d) linear list

0 Answers  


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);

8 Answers   HCL,


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 ?

1 Answers  


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

4 Answers  


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. &#61550; 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. &#61550; 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. &#61550; Sequence of take-off is the sequence of addition to the waitlist

0 Answers  


how is the examination pattern?

0 Answers   Wipro,


how to add numbers without using arithmetic operators.

14 Answers   TCS,


Categories