please give code for this 1 2 4 7 11 16

Answer Posted / 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



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Write a program to produce the following output: 1 2 3 4 5 6 7 8 9 10

15028


What is the most efficient way to store flag values?

676


Explain what is the benefit of using #define to declare a constant?

599


What do you mean by c?

574


What is the value of a[3] if integer a[] = {5,4,3,2,1}?

656






What is operator promotion?

615


a value that does not change during program execution a) variabe b) argument c) parameter d) none

682


why return type of main is not necessary in linux

1691


Why flag is used in c?

644


Explain how are portions of a program disabled in demo versions?

642


What is the heap in c?

632


What are local static variables? How can you use them?

635


write a program to concatenation the string using switch case?

1547


Suggesting that there can be 62 seconds in a minute?

588


What is the importance of c in your views?

582