please give code for this 1 2 4 7 11 16
Answer Posted / 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 |
Post New Answer View All Answers
This is a variation of the call_me function in the previous question:call_me (myvar)int *myvar;{ *myvar += 5; }The correct way to call this function from main() will be a) call_me(myvar) b) call_me(*myvar) c) call_me(&myvar) d) expanded memory
which is conditional construct a) if statement b) switch statement c) while/for d) goto
Write a program to reverse a given number in c language?
Explain what is meant by high-order and low-order bytes?
Create a structure to specify data on students given below: Roll number, Name, Department, Course, Year of joining Assume that there are not more than 450 students in the college. 1.write a function to print names of all students who joined in a particular year 2.write a function to print the data of a student whose roll number is given
I have a varargs function which accepts a float parameter?
What is the difference between NULL and NUL?
What does 3 mean in texting?
What is static function in c?
What is a shell structure examples?
Why & is used in c?
What are the different types of data structures in c?
Should a function contain a return statement if it does not return a value?
What is the difference between printf and scanf )?
How #define works?