//find a number positive or negative using if-else statement
#include <stdio.h>
int main (){
int num;
printf ("Enter the number :");
scanf ("%i",&num);
if (num>0){
printf ("%i is the positive number ",num);
}
else if(num<0) {
printf ("%i is the negative number ",num);}
else {
printf ("0 is the neither positive nor negative ");
}
return 0;
}
No comments:
Post a Comment