38.9k views
5 votes
Using while loop, write a C++ program that will compute and display the square roots of the first 25 odd positive integers starting from 1.

User Foster
by
7.5k points

1 Answer

1 vote

Answer:

#include <iostream>

#include <cmath>

using namespace std;

int main()

{

int i = 1;

while (i <= 25)

{

cout << i*i << endl;

i += 2;

}

return 0;

}

User Yaugenka
by
6.6k points