please give code for this 1 2 4 7 11 16

Answer Posted / ashish tiwari

#include<stdio.h>
#include<conio.h>
void main()
{
int p=1,i;
for(i=1;i<=6;i++)
{
printf("%d ",p);
p+=i;
}
getch();
}

Is This Answer Correct ?    4 Yes 8 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is linear search?

668


Define recursion in c.

688


Can a local variable be volatile in c?

566


What are enumerated types?

640


swap 2 numbers without using third variable?

650






What is stack in c?

595


What is build process in c?

632


Explain high-order bytes.

660


Why c is called top down?

613


Why main is not a keyword in c?

637


What is 1f in c?

1818


What is unary operator?

644


What is void main () in c?

718


When should a type cast not be used?

613


stripos — Find position of first occurrence of a case- insensitive string int stripos ( char* haystack, char* needle, int offset ) Returns the numeric position of the first occurrence of needle in the haystack string. Note that the needle may be a string of one or more characters. If needle is not found, stripos() will return -1. The function should not make use of any C library function calls.

1836