Answer to Question #142155 in C++ for zain

Question #142155

Print the square roots of the first 25 odd positive integers. 


1
Expert's answer
2020-11-04T17:53:35-0500


#include <iostream>

#include <cmath>

#include <iomanip>




int main()

{

for (int n = 1, i = 0; i < 25; n += 2, ++i)

{

std::cout << "Number " << n << " has square root: " << std::fixed << std::setprecision(5) << std::sqrt(n) << std::endl;

}




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