===========================================================================
CODING
#include<iostream.h>
#include<conio.h>
#include<math.h>
float check(float);
void main()
{
clrscr();
float N;
int i;
cout<<"Enter any Number: ";
cin>>N;
i=check(N);
if(i==0)
cout<<"\n\nThe Number Entered is 0";
else if(i==1)
cout<<"\n\nThe Number Entered is Positive";
else if(i==-1)
cout<<"\n\nThe Number Entered is Negative";
getch();
}
float check(float N)
{
if(N==0)
return 0;
else if(N>0)
return 1;
else if(N<0)
return -1;
}
CODING
#include<iostream.h>
#include<conio.h>
#include<math.h>
float check(float);
void main()
{
clrscr();
float N;
int i;
cout<<"Enter any Number: ";
cin>>N;
i=check(N);
if(i==0)
cout<<"\n\nThe Number Entered is 0";
else if(i==1)
cout<<"\n\nThe Number Entered is Positive";
else if(i==-1)
cout<<"\n\nThe Number Entered is Negative";
getch();
}
float check(float N)
{
if(N==0)
return 0;
else if(N>0)
return 1;
else if(N<0)
return -1;
}
===========================================================================
No comments:
Post a Comment