Re-write(convert) the following C++ code using do-while loop instead of for-loop and write the program output. #include using namespace std; int main () { int i=1, sum= 0; cout


Re-write(convert) the following C++ code using do-while loop instead
of for-loop and write the program output.


#include
using namespace std;
int main ()
{
int i=1, sum= 0;
cout < "\n\n="" display="" 10="" terms="" of="" natural="" number="" and="" their="">
cout <>
cout < "="" the="" natural="" numbers="" up="" to="" 10th="" terms="" are:="">
for (;;)
{
cout < i="">< "="">
sum=sum+i;
if(i<>
{
break;


}
I++;


}


cout < "\n="" the="" sum="" of="" the="" natural="" numbers="" is:=""><>
}



Jun 01, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here