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

Answers were Sorted based on User's Feedback



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

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

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

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

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

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

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

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

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

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

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

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

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

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

Post New Answer

More C Interview Questions

What are terms in math?

0 Answers  


what is disadvantage of pointer in C

13 Answers   Tech Mahindra,


where do we use structure pointer?

1 Answers  


Why is void main used?

0 Answers  


What does do in c?

0 Answers  






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);}

3 Answers  


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.

3 Answers  


what is the diference between pointer to the function and function to the pointer?

2 Answers   Infosys,


What is cohesion and coupling in c?

0 Answers  


write a program to rearrange the array such way that all even elements should come first and next come odd

0 Answers  


Is it better to use a macro or a function?

0 Answers  


What does c mean in standard form?

0 Answers  


Categories