Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //branching with if
- #include<stdio.h>
- int main()
- {
- printf("branching with if \n\n");
- int number;
- printf("Please enter a number: ");
- scanf("%d",&number);
- if(number>0)
- {
- printf("The number is positive\n");
- }
- else if(number<0)
- {
- printf("The number is negative\n");
- }
- else
- {
- printf("The number is zero\n");
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement