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
:
:
#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;
}
Comments
Leave a comment