Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdbool.h>
- int main(void) {
- int userNum;
- bool isPositive;
- bool isEven;
- scanf("%d", &userNum);
- isPositive = (userNum > 0);
- isEven = ((userNum % 2) == 0);
- if(isPositive && isEven){
- printf("Positive even number");
- }
- else if(isPositive && !isEven){
- printf("Positive number");
- }
- else{
- printf("Not a positive number");
- }
- printf("\n");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment