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 - The basic salary of an employee is decided at the time of employment, which may be different for different employees. Apart from basic employee gets 10% of basic as house rent, 30& basic as dearness allowance. A professional tax 5% of basic is deducted from salary. Accept the employee id and basic salary for an employee and output the take home salary of the employee
June 01, 2018
C Program - A cashier has currency notes of denomination 1, 5 and 10 . Accept the amount to be withdrawn from the user and print the total number of currency notes of each denomination the cashier will have to give
June 01, 2018
C Program - Accept the x and y coordinates of two point and compute the distance between the two points
June 01, 2018
Follow Us
Tags
Powered by Blogger
0 Comments