Facebook
From Thiwanga Sandaruwan, 4 Months ago, written in C++.
Embed
Download Paste or View Raw
Hits: 29
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main ()
  5. {
  6.     int number1,resault;
  7.     cout<<"Enter your number"<<endl;
  8.     cin>>number1;
  9.  
  10.     resault=number1%2;
  11.  
  12.     if (resault==1)
  13.     {
  14.         cout<<"This number is odd"<<endl;
  15.     }
  16.     else
  17.     {
  18.         cout<<"This number is even"<<endl;
  19.     }
  20.     return 0;
  21. }
  22.