if the number <0 the output is print the number is negative else if the number >0 the output is print the number is positive
#include <stdio.h>
#include <stdlib.h>
int main()
{
int number;
printf("\n\t enter the number =");
scanf("%d",&number);
if(number<0){
printf("\n\t %d is a Negative number",number);
}else
if (number>0){
printf("\n\t %d is a Positive number",number);
}
return 0;
}
the output
the first test
enter the number = 6
6 is a Positive number
the second test
enter the number = -6
-6 is a Negative number
No comments:
Post a Comment