Computer Science, asked by Riyajangra, 1 year ago

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 ratnajitroy02
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
ratnajitroy02: my pleasure
Similar questions