Write a programe print the sum of series 0,1,2,.....10

Answer Posted / athiyaman

#include<stdio.h>
void main()
{
int i,sum=0;
for(i=0;i<=10;i++)
sum=sum+i;
printf("sum=%d",sum);
}

Is This Answer Correct ?    6 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the acronym for ansi?

626


When I set a float variable to, say, 3.1, why is printf printing it as 3.0999999?

580


What are variables and it what way is it different from constants?

782


What is n in c?

570


How can I implement sets or arrays of bits?

601






Explain how do you print an address?

652


What language is windows 1.0 written?

571


What is the most efficient way to count the number of bits which are set in an integer?

587


what are the 10 different models of writing an addition program in C language?

1434


What is the auto keyword good for?

616


why use "return" statement a) on executing the return statement it immediately transfers the control back to the calling program b) it returns the value present in the parentheses return, to the calling program c) a & b d) none of the above

605


Can variables be declared anywhere in c?

614


Describe newline escape sequence with a sample program?

648


The % symbol has a special use in a printf statement. How would you place this character as part of the output on the screen?

763


What does stand for?

590