Write a program using math function to:
a) print the higher or equivalent value of the number
b) round of value of the number
c) square root of a number based on users choice
plz answer fast.....
Answers
Answered by
1
Solution:
#include
using namespace std;
int main()
{
int n = 25;
while ( n != 1 )
{
cout << n << endl;
bool isEven = n%2 == 0;
if ( isEven )
{
n = n/2;
}
else
{
n = 3*n + 1;
}
}
}
This is just an example to how to do it
Similar questions
Social Sciences,
3 months ago
Environmental Sciences,
3 months ago
Hindi,
7 months ago
Biology,
11 months ago
Biology,
11 months ago