Write a program to print series of even number less than or equal to 50 & also calculate sum using for loop
//Write a program to print series of even number less than or equal to 50 & also calculate sum using for loop #include<stdio.h> #include<conio.h> void main() { int i,sum=0; clrscr(); for(i=2;i<=50;i=i+2) { printf("%d",i); sum=sum+i; } printf("Sum = %d",sum); getch(); }
Comments
Post a Comment