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

totally how much header files r in c language

8 Answers   TCS,


How we can insert comments in a c program?

0 Answers  


What is calloc() function?

0 Answers  


any string of bits of length 'n' represents a unique non- negative integer between.............?

2 Answers  


What is the difference between typedef struct and struct?

0 Answers  






wat is the output int main() { char s1[]="Hello"; char s2[]="Hello"; if(s1==s2) printf("Same"); else printf("Diff"); }

3 Answers  


how to find string length wihtout using c function?

6 Answers  


How would you print out the data in a binary tree, level by level, starting at the top?

6 Answers   Amazon, Microsoft,


What is the purpose of the following code? Is there any problem with the code? void send(int count, short *to, short *from) { /* count > 0 assumed */ register n = (count + 7) / 8; switch (count % 8) { case 0: do { *to = *from++; case 7: *to = *from++; case 6: *to = *from++; case 5: *to = *from++; case 4: *to = *from++; case 3: *to = *from++; case 2: *to = *from++; case 1: *to = *from++; } while (--n > 0); } }

0 Answers   Google,


What is void main ()?

0 Answers  


please give me some tips for the selection in TCS.

3 Answers   TCS,


what r callback function?

1 Answers  


Categories