/* program to find sqrtn if n>0 & n5 if n<0 */
#include<iostream.h>
#include<math.h>
#include<conio.h>
void main()
{
clrscr();
int n,r;
cout<<"Enter no"<<endl;
cin>>n;
if((n>0)&&(n%2==1))
r = sqrt (n);
else if((n<0))
r=pow(n,5);
cout<<"Result ="<<r;
getch();
}
Not Satisfied ? Just search & get the result
Related posts:
- C++ program – calculate a to the power b without using power function
- C++ program – Implementation of class
- Sample – Program to enter a sentence and output the number of uppercase & lowercase consonants, uppercase & lowercase vowels in sentence..
- C++ program – Swap two variables using function overloading
- Sample – convert temperatures
