A C++ Program to Check For Even Or Odd Number - Wisdom Lighter

Sunday, 1 July 2018

A C++ Program to Check For Even Or Odd Number

Takes input from the user, and checks whether the number entered is even or odd.

#include <iostream>
#include <stdio.h>
#include <conio.h>

using namespace std;

int main ()

{

 int test ;
 cout << " Enter a number to check even or odd " << endl;
 cin >> test ;

 if (test % 2 == 0) {

cout << " its a even number " << endl ;

 } else {

cout << " its an odd number " << endl ;

 }

  getch();

1 comment:
Write comments
  1. Here at this site really the fastidious material collection so that everybody can enjoy a lot.

    Creative Logo

    ReplyDelete