Wednesday 30 January 2013

sum of five number

include<iostream.h>
#include<conio.h>
void main()
{int c,sum;
c=1;
sum=0;
while(c<=5)
{cout<<"number is:"<<c<<endl;
sum=sum+c;
c=c+1;}
cout<<"sum:"<<sum<<endl;
getch();
}

0 comments:

Post a Comment