write a program to print the sum of even number from 1 to 100
Answers
Answered by
0
#include <stdio.h>
#include<conio.h>
int main()
{
int i, 100, sum=0;
printf("Enter upper limit: ");
scanf("%d", &100);
for(i=2; i<=100; i+=2)
{
/* Add current even number to sum */
sum += i;
}
printf("Sum of all even number between 1 to %d = %d", 100, sum);
return 0;
}
dessuabewa:
can't we say
Similar questions
Social Sciences,
7 months ago
Math,
7 months ago
English,
7 months ago
Science,
1 year ago
Science,
1 year ago