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 ? | 97 Yes | 50 No |
Post New Answer View All Answers
Hai sir, I had planned to write the NIC scientific engineer exam , plz post the sample question......
When should a type cast not be used?
What is the meaning of typedef struct in c?
What are the different types of control structures in programming?
What is signed and unsigned?
Do string constants represent numerical values?
With the help of using classes, write a program to add two numbers.
what is different between auto and local static? why should we use local static?
What does #pragma once mean?
Explain what are its uses in c programming?
An instruction which is analysed and acted upon by the processor prior to the compiler going its work a) directive b) constructive c) constant d) absolute mode
Explain what are run-time errors?
Do variables need to be initialized?
What is the function of volatile in c language?
Where we use clrscr in c?