Write a c code segment using a for loop that calculates and
prints the sum of the even integers from 2 to 30, inclusive?
Answer Posted / parekh nirav
#include<stdio.h>
#include<conio.h>
void main()
{
int i,no,sum=0;
clrscr();
printf("\n entre the no:-");
scanf("%d",&no);
for(i=2;i<=30;i+1)
{
printf("\n the list is %d",i);
sum=sum+i;
}
printf("\n the sum is %d",sum);
getch();
}
| Is This Answer Correct ? | 4 Yes | 3 No |
Post New Answer View All Answers
any limit on the number of functions that might be present in a C program a) max 35 functions b) max 50 functions c) no limit d) none of the above
Why void main is used in c?
What is void main () in c?
What is #include stdio h and #include conio h?
Write an efficient algo and C code to shuffle a pack of cards.. this one was a feedback process until we came up with one with no extra storage.
How do I determine whether a character is numeric, alphabetic, and so on?
Explain pointer. What are function pointers in C?
What does d mean?
How to declare pointer variables?
Tell us the use of fflush() function in c language?
Is c high or low level?
Is file a keyword in c?
What is c language and why we use it?
What is character set?
What is difference between far and near pointers?