Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Program to input a number and check if it's positive, negative or zero.
- #include<stdio.h>
- #include<conio.h>
- void main()
- {
- int number;
- clrscr();
- printf("Enter a number: ");
- scanf("%d", &number);
- if(number > 0)
- printf("The number %d is positive.", number);
- else if(number < 0)
- printf("The number %d is negative.", number);
- else
- printf("The numebr %d is zero.", number);
- getch();
- }
Advertisement
Add Comment
Please, Sign In to add comment