Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* C programme to check if a number is positive or not */
- #include<stdio.h>
- int main(void)
- {
- float a;
- printf("enter a number to check whether it is positive or not\n");
- scanf("%f",&a);
- if(a>0)
- {
- printf("positive\n");
- }
- else if(a<0)
- {
- printf("negative\n");
- }
- else
- {
- printf("zero\n");
- }
- return 0;
- }
Add Comment
Please, Sign In to add comment