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

Differentiate between Macro and ordinary definition.

0 Answers   Motorola,


What is table lookup in c?

0 Answers  


Describe dynamic data structure in c programming language?

0 Answers  


Explain what is the use of a semicolon (;) at the end of every program statement?

0 Answers  


1 232 34543 4567654 can anyone tell me how to slove this c question

6 Answers  






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

0 Answers   ADP,


Why is c known as a mother language?

0 Answers  


What is main return c?

0 Answers  


can we change the default calling convention in c if yes than how.........?

0 Answers   Aptech,


What are the types of data types and explain?

0 Answers  


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"

15 Answers   Accenture,


What is typedef example?

0 Answers  


Categories