SlideShare a Scribd company logo
1 of 2
Practical No.-6
Aim

: To demonstrate the program to check the
Even & odd numbers.

Source code :

#include<iostream.h>
#include<conio.h>
void main()
{
int a;
cout <<”Enter the value of a”;
cin >>a;
if (a%2=0)
cout<<”the number is an even number”;
else if(a%5=0)
cout<<”the number is an odd number”;
}

Output

:

Enter the value of a =4
the number is an even number
Enter the value of a=3
the number is an odd number
Practical no 6

More Related Content

What's hot

Practical write a c program to reverse a given number
Practical write a c program to reverse a given numberPractical write a c program to reverse a given number
Practical write a c program to reverse a given numberMainak Sasmal
 
Practical write a c program to reverse a given number
Practical write a c program to reverse a given numberPractical write a c program to reverse a given number
Practical write a c program to reverse a given numberMainak Sasmal
 
Compiler design lab
Compiler design labCompiler design lab
Compiler design labilias ahmed
 
Call by value
Call by valueCall by value
Call by valueDharani G
 
Write a program that accepts percentage from the user and displays its grade ...
Write a program that accepts percentage from the user and displays its grade ...Write a program that accepts percentage from the user and displays its grade ...
Write a program that accepts percentage from the user and displays its grade ...Farwa Aqeel
 
Simple c program
Simple c programSimple c program
Simple c programRavi Singh
 
Core programming in c
Core programming in cCore programming in c
Core programming in cRahul Pandit
 
Testing lecture after lec 4
Testing lecture after lec 4Testing lecture after lec 4
Testing lecture after lec 4emailharmeet
 
How c program execute in c program
How c program execute in c program How c program execute in c program
How c program execute in c program Rumman Ansari
 
Factorial Program in C
Factorial Program in CFactorial Program in C
Factorial Program in CHitesh Kumar
 
C Programming Language Part 7
C Programming Language Part 7C Programming Language Part 7
C Programming Language Part 7Rumman Ansari
 

What's hot (20)

88 c-programs
88 c-programs88 c-programs
88 c-programs
 
Practical no 1
Practical no 1Practical no 1
Practical no 1
 
Practical write a c program to reverse a given number
Practical write a c program to reverse a given numberPractical write a c program to reverse a given number
Practical write a c program to reverse a given number
 
Practical write a c program to reverse a given number
Practical write a c program to reverse a given numberPractical write a c program to reverse a given number
Practical write a c program to reverse a given number
 
Compiler design lab
Compiler design labCompiler design lab
Compiler design lab
 
Call by value
Call by valueCall by value
Call by value
 
C Programming Example
C Programming Example C Programming Example
C Programming Example
 
Write a program that accepts percentage from the user and displays its grade ...
Write a program that accepts percentage from the user and displays its grade ...Write a program that accepts percentage from the user and displays its grade ...
Write a program that accepts percentage from the user and displays its grade ...
 
C Programming Example
C Programming ExampleC Programming Example
C Programming Example
 
Simple c program
Simple c programSimple c program
Simple c program
 
Core programming in c
Core programming in cCore programming in c
Core programming in c
 
First c program
First c programFirst c program
First c program
 
Testing lecture after lec 4
Testing lecture after lec 4Testing lecture after lec 4
Testing lecture after lec 4
 
How c program execute in c program
How c program execute in c program How c program execute in c program
How c program execute in c program
 
Factorial
FactorialFactorial
Factorial
 
Factorial Program in C
Factorial Program in CFactorial Program in C
Factorial Program in C
 
C Programming
C ProgrammingC Programming
C Programming
 
comp2
comp2comp2
comp2
 
C Programming Language Part 7
C Programming Language Part 7C Programming Language Part 7
C Programming Language Part 7
 
Compiler design lab programs
Compiler design lab programs Compiler design lab programs
Compiler design lab programs
 

Viewers also liked

δελτιο τυπου.τροπολογια και παρεμβαση στην επιτροπη εμποριου 1
δελτιο τυπου.τροπολογια και παρεμβαση στην επιτροπη εμποριου 1δελτιο τυπου.τροπολογια και παρεμβαση στην επιτροπη εμποριου 1
δελτιο τυπου.τροπολογια και παρεμβαση στην επιτροπη εμποριου 1dakekavalas
 
14.01.14.Defesa Divil Nacional reconhece situação de emergência do município ...
14.01.14.Defesa Divil Nacional reconhece situação de emergência do município ...14.01.14.Defesa Divil Nacional reconhece situação de emergência do município ...
14.01.14.Defesa Divil Nacional reconhece situação de emergência do município ...Guy Valerio Barros dos Santos
 
Production schedule
Production scheduleProduction schedule
Production schedulealferentinos
 
Erick Nistal -Resume D2
Erick Nistal -Resume D2Erick Nistal -Resume D2
Erick Nistal -Resume D2Erick Nistal
 
Design, Testing and Validation of a Scale Model Semisubmersible Offshore Wind...
Design, Testing and Validation of a Scale Model Semisubmersible Offshore Wind...Design, Testing and Validation of a Scale Model Semisubmersible Offshore Wind...
Design, Testing and Validation of a Scale Model Semisubmersible Offshore Wind...Laura Rolo
 
Teaching Bioinformatics data analysis using Medicago truncatula as a model - ...
Teaching Bioinformatics data analysis using Medicago truncatula as a model - ...Teaching Bioinformatics data analysis using Medicago truncatula as a model - ...
Teaching Bioinformatics data analysis using Medicago truncatula as a model - ...Vivek Krishnakumar
 
Arte total 2016 programação
Arte total 2016 programaçãoArte total 2016 programação
Arte total 2016 programaçãoPlay Bleu Blogspot
 
Production schedule
Production scheduleProduction schedule
Production schedulealferentinos
 

Viewers also liked (10)

δελτιο τυπου.τροπολογια και παρεμβαση στην επιτροπη εμποριου 1
δελτιο τυπου.τροπολογια και παρεμβαση στην επιτροπη εμποριου 1δελτιο τυπου.τροπολογια και παρεμβαση στην επιτροπη εμποριου 1
δελτιο τυπου.τροπολογια και παρεμβαση στην επιτροπη εμποριου 1
 
14.01.14.Defesa Divil Nacional reconhece situação de emergência do município ...
14.01.14.Defesa Divil Nacional reconhece situação de emergência do município ...14.01.14.Defesa Divil Nacional reconhece situação de emergência do município ...
14.01.14.Defesa Divil Nacional reconhece situação de emergência do município ...
 
Production schedule
Production scheduleProduction schedule
Production schedule
 
Erick Nistal -Resume D2
Erick Nistal -Resume D2Erick Nistal -Resume D2
Erick Nistal -Resume D2
 
Design, Testing and Validation of a Scale Model Semisubmersible Offshore Wind...
Design, Testing and Validation of a Scale Model Semisubmersible Offshore Wind...Design, Testing and Validation of a Scale Model Semisubmersible Offshore Wind...
Design, Testing and Validation of a Scale Model Semisubmersible Offshore Wind...
 
Teaching Bioinformatics data analysis using Medicago truncatula as a model - ...
Teaching Bioinformatics data analysis using Medicago truncatula as a model - ...Teaching Bioinformatics data analysis using Medicago truncatula as a model - ...
Teaching Bioinformatics data analysis using Medicago truncatula as a model - ...
 
Arte total 2016 programação
Arte total 2016 programaçãoArte total 2016 programação
Arte total 2016 programação
 
Production schedule
Production scheduleProduction schedule
Production schedule
 
Practical no 4
Practical no 4Practical no 4
Practical no 4
 
Practical no 2
Practical no 2Practical no 2
Practical no 2
 

Practical no 6

  • 1. Practical No.-6 Aim : To demonstrate the program to check the Even & odd numbers. Source code : #include<iostream.h> #include<conio.h> void main() { int a; cout <<”Enter the value of a”; cin >>a; if (a%2=0) cout<<”the number is an even number”; else if(a%5=0) cout<<”the number is an odd number”; } Output : Enter the value of a =4 the number is an even number Enter the value of a=3 the number is an odd number