Tuesday 5 February 2013

find a given number is positive or negative number in C without if statement, relational and conditional operator

====List Of Defination Clickk Me========


# include <math.h>
# include <stdio.h>
# include <conio.h>
void main()
{
clrscr();
int p,n;
printf("Enter two no=");
scanf("%d",&amp;p);
switch(n=abs(p) +(-p))
{
case 0:
{
printf("Positiv e number");
break;
}
default:
{
printf("Negativ e number");
break;
}
}
getch();
}


====List Of Defination Clickk Me========

 

No comments:

Post a Comment

Comment