please give code for this 1 2 4 7 11 16

Answer Posted / 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 ?    98 Yes 51 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain how can I right-justify a string?

714


which of the following is allowed in a "C" arithematic instruction a) [] b) {} c) () d) none of the above

1254


Describe the complexity of Binary search, Quicksort and various other sorting and searching techniques..

734


What does sizeof function do?

724


What is a null string in c?

682






How does struct work in c?

703


What is the difference between text files and binary files?

791


Explain what does it mean when a pointer is used in an if statement?

710


a sequence of bytes with one to one corrspondence to those in the external device a) sequential addressing b) address c) byte code d) none

845


C language questions for civil engineering

1341


What are the 5 organizational structures?

666


Explain how do you search data in a data file using random access method?

777


What is the use of extern in c?

738


What is the difference between #include and #include 'file' ?

698


What is bash c?

648