Home
Mega Menu
FYBCS
_C
_HTML & CSS
SYBCS
_DS
_SCILAB
TYBCS
_JAVA
_PHP
Download Apk
Home
c
C Program - Write a program to accept an integer and check if it is even or odd
C Program - Write a program to accept an integer and check if it is even or odd
prozone
June 01, 2018
Program
#include <stdio.h>
int main()
{
int number;
printf("Enter an integer: ");
scanf("%d", &number);
if(number % 2 == 0)
printf("%d is even.", number);
else
printf("%d is odd.", number);
}
Output:
Enter an integer: 4
4 is even.
Post a Comment
0 Comments
Popular Posts
C Program - Accept initial Velocity (u), acceleration (a) and time (t). print the final velocity (v) and the distance (s) travelled .
May 31, 2018
C Program - Accept inner and outer radius of a ring and print the perimeter and area of the ring .
May 31, 2018
C Program - Write a program to accept a matrix A of size mXn and store its transpose in matrix B. Display matrix B. Write separate functions
June 15, 2018
Follow Us
Tags
Powered by Blogger
0 Comments