Write a programe print the sum of series 0,1,2,.....10
Answer Posted / 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 |
Post New Answer View All Answers
What does a pointer variable always consist of?
Explain how can a program be made to print the line number where an error occurs?
What is the difference between ‘g’ and “g” in C?
Which operators cannot be overloaded a) Sizeof b) .* c) :: d) all of the above
writ a program to compare using strcmp VIVA and viva with its output.
What are the valid places to have keyword “break”?
What are the types of i/o functions?
Explain how can type-insensitive macros be created?
How can I check whether a file exists? I want to warn the user if a requested input file is missing.
How do you convert strings to numbers in C?
Difference between Function to pointer and pointer to function
Write a program to check prime number in c programming?
What is a protocol in c?
What is boolean in c?
What is the difference between array and pointer?