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

How can I write data files which can be read on other machines with different word size, byte order, or floating point formats?

614


Explain the difference between the local variable and global variable in c?

602


What is static function in c?

635


How can I manipulate strings of multibyte characters?

639


Simplify the program segment if X = B then C ← true else C ← false

2583






Write a program to reverse a linked list in c.

645


What would the following code segment printint k = 8;docout << "k = " << k << " ";while k++ < 5; a) 13 b) 5 c) 8 d) pointers

677


How many types of errors are there in c language? Explain

573


What is the difference between far and near in c?

602


console I/O functions means a) the I/O operations done on disk b) the I/O operations done in all parts c) the input given through keyboard is displayed VDU screen d) none of the above

655


Is fortran faster than c?

581


What is the use of printf() and scanf() functions?

635


Explain the difference between call by value and call by reference in c language?

647


Define recursion in c.

702


What is a null string in c?

589