Rewrite the following code using while loop statement instead of for loop statement in C++. #include using namespace std; int main() int i, reps; double usenum, postot(0), negtot(0); cout > reps;...


Rewrite the following code using while loop statement instead of for loop statement in C++.<br>#include <iostream><br>using namespace std;<br>int main()<br>int i, reps;<br>double usenum, postot(0), negtot(0);<br>cout << > reps; for(i = 1; i <= reps;="" ++i)="" {="" cout="">< "enter="" a="" number="" (positive="" or="" negative)="" :="" ";="" cin="">> usenum; if (usenum > 0) postot = postot + usenum; else negtot = negtot + usenum; cout < "the="" negative="" total="" is="" "="">< negtot="">< endl;="" return="" 0;="" "/="">
Extracted text: Rewrite the following code using while loop statement instead of for loop statement in C++. #include using namespace std; int main() int i, reps; double usenum, postot(0), negtot(0); cout < "pls.="" type="" in="" the="" total="" number="" of="" data="" values="" ":="" cin="">> reps; for(i = 1; i <= reps;="" ++i)="" {="" cout="">< "enter="" a="" number="" (positive="" or="" negative)="" :="" ";="" cin="">> usenum; if (usenum > 0) postot = postot + usenum; else negtot = negtot + usenum; cout < "the="" negative="" total="" is="" "="">< negtot="">< endl;="" return="">

Jun 11, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions ยป

Submit New Assignment

Copy and Paste Your Assignment Here