Answer to Question #98765 in C++ for bilal

Question #98765
print the square roots of the first 25 odd positive integers using do while loop.
1
Expert's answer
2019-11-17T12:16:07-0500
// do_loop.cpp
#include <iostream>
#include <cmath>

int main()
{
   int i = 1;
   int count=0;
   do {
       std::cout << "Sqrt(" << i << ") = " << std::sqrt(i) << std::endl;
       i+=2;
       count++;
   } while (count<25);

   return 0;
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS