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 |
Question 1: You want to conduct a survey within your classroom, on the quality of canteen’s food. You ask each of your class fellows to rank the quality of food between 1 and 5 (1 representing excellent quality and 5 representing worst quality). During the survey, you make a list containing the roll# of student and the opinion given by that student. The list can be as follow Roll # Opinion 234 1 235 1 236 5 237 1 238 2 239 3 240 5 241 5 242 1 To get the results of the survey, you need to determine the frequency of each opinion value. The frequency of an opinion is determined by counting the number of students giving that opinion. For example, for the above list the frequency of opinion value 1 is 4 and frequency of opinion value 4 is 0. After getting the frequency of each opinion, you can easily judge about the quality of the food by seeing through the frequency of each opinion. You need to develop a program to calculate the results of this survey. The program inputs the opinion of 50 students and counts the frequency of each opinion. It then displays a report showing the frequency of each opinion. Sample output: Opinion Frequency Remarks 1 5 Excellent 2 10 Good 3 15 Normal 4 10 Bad 5 10 Really bad
without a terminator how can we print a message in a printf () function.
write a program in c language to print your bio-data on the screen by using functions.
6 Answers College School Exams Tests, IBM,
write a program in c language that uses function to locate and return the smallest and largest integers in an array,number and their position in the array. it should also find and return the range of the numbers , that is , the difference between the largest number and the smallest.
how many keywords are available in 'c' language a) 32 b) 34 c) 45 d) 48
can we print any string in c language without using semicolon(;)(terminator) in whole program.
What are formal parameters?
Difference between data structure and data base.
7 Answers CTS, Value Labs, Zoho,
What is the value of c?
what is the difference between north western polytechnique university and your applied colleges?? please give ur answers for this. :)
What is the use of a static variable in c?
Why do some versions of toupper act strangely if given an upper-case letter?