Wednesday 14 August 2013

Lecture 146

Lecture 146

//Procedures and Functions
//Code:
#include <iostream>
#include <conio.h>
using namespace std;
int isEven(int);   // Prototype 
main ()
{
   int i ;
  // Getting the input from the user
  cout<< " Please enter the number " ;
  cin >> i ;
  cout<< " Zero is Even and One is odd \n" ;
  cout << " Even or Odd : " << isEven(i);

  getch();
  return 0;
}
int isEven(int n){  return n%2; }

Output: