c++ programing to input a number .If the number 'n' is odd & positive , print its square root otherwise print n power 5
Answers
Answered by
2
// A simple C++ program to
// check for even or odd
#include <iostream>
using namespace std;
// Returns true if n is
// even, else odd
bool isEven(int n)
{
return (n % 2 == 0);
}
// Driver code
int main()
{
int n = 101;
isEven(n)? cout << "Even" :
cout << "Odd";
return 0;
}
Riyajangra:
thnx
Similar questions