please give code for this 1 2 4 7 11 16

Answer Posted / 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       View All Answers


Please Help Members By Posting Answers For Below Questions

You are to write your own versions of strcpy() and strlen (). Call them mystrcpy() and mystrlen(). Write them first as code within main(), not as functions, then, convert them to functions. You will pass two arrays to the function in the case of mystrcpy(), the source and target array.

1770


4. main() { int c=- -2; printf("c=%d",c); }

1360


Explain the meaning of keyword 'extern' in a function declaration.

707


What is scanf () in c?

652


What is equivalent to ++i+++j?

634






How do you use a pointer to a function?

621


how should functions be apportioned among source files?

616


write a program to create a sparse matrix using dynamic memory allocation.

4363


Is there a built-in function in C that can be used for sorting data?

735


How is a pointer variable declared?

582


What is conio h in c?

611


What are categories used for in c?

552


Tell me what is null pointer in c?

599


What is LINKED LIST? How can you access the last element in a linked list?

621


What is omp_num_threads?

568