bsc

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

prac_003.cpp (752B)


      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 /* Addition of two inputs */
      8 
      9 #include <iostream>
     10 using namespace std;
     11 
     12 class addoftwoinput {
     13     int inp1, inp2, out;
     14 
     15 public:
     16     void input();
     17     void calculation();
     18     void output();
     19 };
     20 
     21 void addoftwoinput ::input() {
     22     cout << "\nInsert the 1st number : ";
     23     cin >> inp1;
     24     cout << "\nInsert the 2nd number : ";
     25     cin >> inp2;
     26 }
     27 
     28 void addoftwoinput ::calculation() {
     29     out = inp1 + inp2;
     30 }
     31 
     32 void addoftwoinput ::output() {
     33     cout << "\nSum of " << inp1 << " and " << inp2 << " is : " << out;
     34 }
     35 
     36 int main() {
     37     addoftwoinput z;
     38     z.input();
     39     z.calculation();
     40     z.output();
     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