30. WAP to check given integer is positive or negative using conditional operator.
#include<stdio.h>
void
main()
{
int num;
printf("Enter a number : ");
scanf("%d",&num);
num>>31&1 ?
printf("Negative\n") : printf("Positive\n");
}
Comments
Post a Comment