Advertisement
Mahmud33

a number is negative, positive or zero

May 25th, 2019
135
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.29 KB | None | 0 0
  1. #include<stdio.h>
  2. int main()
  3. {
  4.     int a;
  5.     printf("Enter a number:");
  6.     scanf("%d", &a);
  7.  
  8.     if(a>0){
  9.         printf("Positive");
  10.     }
  11.     else if(a<0){
  12.         printf("Negative");
  13.     }
  14.     else if(a == 0){
  15.         printf("The number is zero");
  16.     }
  17.     return 0;
  18.  
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement