Skip to content

Instantly share code, notes, and snippets.

@mmikhan
Created March 20, 2015 18:02
Show Gist options
  • Save mmikhan/816ac78bec189926d55d to your computer and use it in GitHub Desktop.
Save mmikhan/816ac78bec189926d55d to your computer and use it in GitHub Desktop.
Display the result of a number is even or odd
//
// main.c
// midterm
//
// Created by Md Mazedul Islam Khan on 3/20/15.
// Copyright (c) 2015 Md Mazedul Islam Khan. All rights reserved.
//
#include <stdio.h>
int main(int argc, const char * argv[]) {
// insert code here...
int input;
scanf("Please insert an number %d: ", &input);
if (input % 2 == 0) {
printf("The number is even");
} else {
printf("The number is odd");
}
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment