Home
The Crazy Programmer
Home
BOOKS
C Programming
C++ Programming
Digital Logic Design
C Programs
Basic Programs tutorial
Programs Tutorial
Projects for C
C++ Programs
Basic Programs tutorials
Programs tutorials
Projects for C++
CGPA Calculator
Tech UOG
Important Questions For Exams
Saturday, 23 September 2017
C Program to Check Number is Even or Odd
September 23, 2017
If-else In C
No comments
Here you will get C program to check given number is even or odd.
We will use following simple logic in this program.
If a number is divisible by 2 then it is even.
If a number is not divisible by 2 then it is odd.
Output
Enter any number:17
The number is odd
#include
int main() { int n; printf("Enter any number:"); scanf("%d",&n); if(n%2==0) printf("The number is even"); else printf("The number is odd"); return 0; }
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#
Email This
BlogThis!
Share to X
Share to Facebook
Newer Post
Older Post
Home
0 comments:
Post a Comment
Subscribe to:
Post Comments (Atom)
Tech UOG
Social Profiles
Popular
Tags
Blog Archives
Contact Form
Name
Email
*
Message
*
C++ program For Calculating University CGPA
#include <iostream> using namespace std; class Profile { public : string ...
C++ Program For Hostel Management System
#include <iostream> using namespace std; #include <fstream> #include <stdio.h> class hostel { ...
Search This Blog
About Me
Unknown
View my complete profile
Powered by
Blogger
.
Blog Archive
December 2018
(1)
May 2018
(1)
March 2018
(2)
February 2018
(5)
January 2018
(3)
December 2017
(32)
September 2017
(22)
August 2017
(10)
July 2017
(5)
June 2017
(17)
Categories
Basic
(1)
Basic for C
(1)
C Programs
(9)
CGPA Calculator
(1)
Codes For C++
(2)
Constants and Keywords in C
(1)
i/o "input
(2)
If-else In C
(6)
Introduction of C Programming
(1)
Loop in C
(8)
output stream"
(2)
Programming
(1)
Projects For C
(15)
Projects For C++
(14)
questions for exams
(12)
Tech UOG
(1)
Variables
(1)
0 comments:
Post a Comment