Created
November 26, 2012 16:45
-
-
Save holachek/4149246 to your computer and use it in GitHub Desktop.
Even or Odd program
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Tell me, is a number even or odd? | |
// Bug #1: Long integers cause scanf to truncate userNumber | |
#include <stdio.h> | |
int main() | |
{ | |
int userNumber = 0; | |
printf("Enter an integer, please:"); | |
scanf("%d", &userNumber); | |
if(userNumber%2 == 0){ | |
printf("EVEN :)"); | |
} else { | |
printf("ODD :("); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment