Virajsinh

A_PRM_14

Oct 7th, 2017
216
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.41 KB | None | 0 0
  1. /* Write a program to test whether a no. is positive,
  2. negative, or equal to zero. */
  3.  
  4. #include<conio.h>
  5. #include<stdio.h>
  6.  
  7. void main()
  8. {
  9.     int a;
  10.     clrscr();
  11.     fflush(stdin);
  12.  
  13.     printf("\n Enter Value : ");
  14.     scanf("%d", &a);
  15.  
  16.     if(a==0)
  17.     {
  18.         printf(" You Enter Value is 0");
  19.     }
  20.     else if (a > 0)
  21.     {
  22.         printf(" Enter Value is Positive");
  23.     }
  24.     else
  25.     {
  26.         printf(" Enter Value is Negative");
  27.     }
  28.     getch();
  29. }
Add Comment
Please, Sign In to add comment