Popular Posts

5.Write a program using do while and show sum and I .

5.Write a program using do while and show sum and I .


#include
#include
int main()
{
clrscr();
int I,sum;
I=1;
sum=0;
do
{
sum=sum+I;
I=I+2;
}
while(sum<40||I<10);
cout<<"sum= "< getch();
return 0;
}

Output:

sum= 49
I= 15

No comments: