Advertisement
afrinahoque

Positive or negative or zero using function

Jul 6th, 2019
116
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.30 KB | None | 0 0
  1. #include<stdio.h>
  2. void checkNum(n)
  3. {
  4.     if(n>0)
  5.     {
  6.         printf("Positive.");
  7.     }
  8.  
  9.     else if(n<0)
  10.     {
  11.         printf("Negative.");
  12.  
  13.     }
  14.  
  15.     else
  16.     {
  17.         printf("Zero.");
  18.     }
  19.  
  20. }
  21. int main()
  22. {
  23.     int n;
  24.     scanf("%d", &n);
  25.     checkNum(n);
  26.     return 0;
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement