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 |
What are terms in math?
what is disadvantage of pointer in C
where do we use structure pointer?
Why is void main used?
What does do in c?
main() {char a[10]={1,2,3,4,5,6};int x; for(x=0;x<4;x++){ b[x]=x+'a';} printf("%s",b);}
how to find out the biggest element (or any other operation) in an array which is dynamic. User need not to mention the array size while executing.
what is the diference between pointer to the function and function to the pointer?
What is cohesion and coupling in c?
write a program to rearrange the array such way that all even elements should come first and next come odd
Is it better to use a macro or a function?
What does c mean in standard form?