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
Why do we use static in c?
What is sizeof in c?
Why is c called "mother" language?
What are unions in c?
What are c identifiers?
1) write a program to generate 1st n fibonacci prime numbers using Nested if 2) write a program to generate twin prime numbers from m to n using nested if 3) write a program to check whether a given integer is a strong number or not using nested if 4) Write a program to generate prime factors of a given integer using nested if 5)write a program to generate prime numbers from m to n using nested if 6)write a program to generate perfect numbers from m to n using nested if 7)write a program to generate the pallindromes from m to n using neste if 8)write a program to generate armstrong numbers from m to n using nested if 9)write a program to generate strong numbers from m to n using nested if
What are structure types in C?
What is structure packing in c?
Can a void pointer point to a function?
Is it cc or c in a letter?
how is the examination pattern?
What is table lookup in c?
I came across some code that puts a (void) cast before each call to printf. Why?
What are the header files used in c language?
What do you mean by keywords in c?