write a c program to print sum of even numbers from 50 to 100
Answers
Answered by
3
Answer:
Explanation:
#include<stdio.h>
int main()
{
int i, number, Sum = 0;
printf("\n Please Enter the Maximum Limit Value : ");
scanf("%d", &number);
printf("\n Even Numbers between 0 and %d are : ", number);
for(i = 2; i <= number; i=i+2)
{
Sum = Sum + i;
printf("%d ", i);
}
printf("\n The Sum of All Even Numbers upto %d = %d", number, Sum);
return 0;
Similar questions