Write a programe print the sum of series 0,1,2,.....10
Answer Posted / mrs.ahmer
#include<stdio.h>
#include<conio.h>
void main()
{
int c,sum;
clrscr();
c=0;
sum=0;
while(c<=10)
{
printf("%d\n",c);
sum=sum+c;
c=c+1;
}
printf("sum is %d",sum);
getch();
}
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
Is there a way to have non-constant case labels (i.e. Ranges or arbitrary expressions)?
Explain setjmp()?
How will you find a duplicate number in a array without negating the nos ?
How do I swap bytes?
Explain how can I open a file so that other programs can update it at the same time?
What is the behavioral difference when include header file in double quotes (“”) and angular braces (<>)?
Explain what happens if you free a pointer twice?
When should the register modifier be used? Does it really help?
When is a null pointer used?
What is static and volatile in c?
how can f be used for both float and double arguments in printf? Are not they different types?
How can I send mail from within a c program?
How do you search data in a data file using random access method?
Explain high-order bytes.
What's a good way to check for "close enough" floating-point equality?