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
What is the use of sizeof?
Write a program to swap two numbers without using the third variable?
What is a nested loop?
I completed my B.tech (IT). Actually I want to develop virtual object that which will change software technology in the future. To develop virtual object what course I have to take. can I any professor to help me.
#include
What is the use of #define preprocessor in c?
Hi how many types of software editions are there and their difference (like home editions, enterprise, standard etc) can u please help me
What are the advantages of Macro over function?
what is the structure pointer?
Where define directive used?
Why we use void main in c?
Difference between Function to pointer and pointer to function
what is associativity explain what is the precidence for * and & , * and ++ how the folloing declaration work 1) *&p; 2) *p++;
What is the usage of the pointer in c?
What is the incorrect operator form following list(== , <> , >= , <=) and what is the reason for the answer?