#include<iostream.h> #include<conio.h> #include<stdlib.h> void main() { int a=1,sum=0; clrscr(); while(a<=10) { sum=sum+a; a++; } cout<<sum; getch(); } OUTPUT: 55
No comments: