Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Even Odd using switch
- #include <stdio.h>
- int main() {
- puts("Enter a integer to determine wether its Even or Odd");
- int num;
- scanf_s("%d", &num);
- switch (num % 2) {
- case 0:
- puts("Even");
- break;
- case 1:
- puts("Odd");
- break;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement