Subscribe to Feeds

Send Your COMPLETED Projects To georgepj@hotmail.com

We'll Publish It With Your Name :-)

Programs Can Also Be Downloaded From The Folders Below....[Or Scroll Down]

Sqrt & Power

Click Here To Download C++ File Of This Program

 //prg to find sqrtn if n>0 & n5 if n<0  
//Downloaded From www.c4cpp.co.nr. (C)2009.All rights reserved.
#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();
}

No comments: