bsc

Comprehensive codebase and cou...
Log | Files | Refs | README | LICENSE

prac_010.cpp (669B)


      1 /*
      2  * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 22 Jun 2026
      3  * Repo: https://github.com/notamitgamer/bsc
      4  * License: MIT
      5  */
      6 
      7 /* check odd or even */
      8 
      9 #include <iostream>
     10 using namespace std;
     11 
     12 class ooe {
     13     int n;
     14 
     15 public:
     16     void input();
     17     void calcdisp();
     18 };
     19 
     20 void ooe::input() {
     21     cout << "Enter the number : ";
     22     cin >> n;
     23 }
     24 
     25 void ooe::calcdisp() {
     26     if (n == 0) {
     27         cout << "0 is neither an odd nor an even number.";
     28     } 
     29     else if (n % 2 == 0) {
     30         cout << n << " is a even number.";
     31     } 
     32     else {
     33         cout << n << " is a odd number.";
     34     }
     35 }
     36 
     37 int main() {
     38     ooe a;
     39     a.input();
     40     a.calcdisp();
     41     return 0;
     42 }
© notamitgamer • Site Built: 2026-07-21 13:58:23 UTC • git-mirror commit: 1037f62 [view raw info]
Originally created with stagit • modified by notamitgamer
Forked from github.com/notamitgamer/git-mirror