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 |
totally how much header files r in c language
How we can insert comments in a c program?
What is calloc() function?
any string of bits of length 'n' represents a unique non- negative integer between.............?
What is the difference between typedef struct and struct?
wat is the output int main() { char s1[]="Hello"; char s2[]="Hello"; if(s1==s2) printf("Same"); else printf("Diff"); }
how to find string length wihtout using c function?
How would you print out the data in a binary tree, level by level, starting at the top?
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); } }
What is void main ()?
please give me some tips for the selection in TCS.
what r callback function?