Answer to Question #280315 in C++ for Josh

Question #280315

Using do while loop, write a C++ program that will compute and display the square roots of the 30 even positive integers starting from 100.



Output:

Square Root of 100: 10

Square Root of 102: 10.0995

Square Root of 104: 10.198

Square Root of 106: 10.2956

Square Root of 108: 10.3923

Square Root of 110: 10.4881

:

:


1
Expert's answer
2021-12-16T14:31:24-0500
#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<30);

   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