Radoan_Ahmed

Untitled

Jul 5th, 2019
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.38 KB | None | 0 0
  1. //a C program to check a given number is positive or negative or zero using function.
  2. #include<stdio.h>
  3. void num_look(int num)
  4. {
  5.     if(num<0)
  6.     {
  7.         printf("Negative");
  8.     }
  9.     else if(num>0)
  10.     {
  11.         printf("positive");
  12.     }
  13.     else
  14.     {
  15.     printf("zero");
  16.     }
  17. }
  18. int main()
  19. {
  20.     int num;
  21.     scanf("%d",&num);
  22.     num_look(num);
  23.     return 0;
  24. }
Add Comment
Please, Sign In to add comment