/*write a c program to add first 10 even numbers*/ #include<stdio.h> #include<conio.h> void main() { int n,sum=0; clrscr(); printf("sum of first 10 even numbers"); for(n=2;n<=20;n=n+2) { sum=sum+n; } printf("sum:%d",sum); getch(); }
No comments:
Post a Comment