Write a programe print the sum of series 0,1,2,.....10
Answers were Sorted based on User's Feedback
Answer / nithya
#include<stdio.h>
main()
{
int i,sum=0;
printf("sum of the series is");
for(i=0;i<10;i++)
{
sum=sum+i;
printf("%d",sum);
}
Is This Answer Correct ? | 16 Yes | 5 No |
Answer / 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 |
Answer / manjushree
Answer #2 doesnot count for integer 10.
int main()
{
int i,temp=0;
printf("sum of series is:");
for(i=0;i<10;i++)
temp+=i;
printf("%d",temp);
getch();
}
Is This Answer Correct ? | 3 Yes | 2 No |
Answer / akash patil
#include<stdio.h>
voind main()
{
int n=10;
printf("sum is %d",n*(n+1)/2;
getch();
}
Is This Answer Correct ? | 1 Yes | 0 No |
Answer / 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 |
Answer / sevak.yatrik777
main()
{
int i;
printf("sum of series is:");
for(i=0;i=10;i++)
i=i+i;
scanf("%d",&i);
printf("%d",i);
}
Is This Answer Correct ? | 0 Yes | 0 No |
Answer / s.m.jyo
main()
{
int i;
printf("sum of series is:");
for(i=0;i=10;i++)
i=i+i;
scanf("%d",&i);
printf("%d",i);
}
Is This Answer Correct ? | 7 Yes | 9 No |
Differentiate between Macro and ordinary definition.
What is table lookup in c?
Describe dynamic data structure in c programming language?
Explain what is the use of a semicolon (;) at the end of every program statement?
1 232 34543 4567654 can anyone tell me how to slove this c question
write a program which the o/p should b in such a way that s triangle if I/p is 3,a Square/rectangle if I/P=4,a pentagon if I/P=5 and so on...forget about the I/P which is less than 3
Why is c known as a mother language?
What is main return c?
can we change the default calling convention in c if yes than how.........?
What are the types of data types and explain?
Which of the following are valid "include" formats? A)#include and #include[file.h] B)#include (file.h) and #include C)#include [file.h] and #include "file.h" D)#include <file.h> and #include "file.h"
What is typedef example?