Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- A file named saber.hpp:-
- #ifndef my_header
- #define my_header
- #include <iostream>
- using namespace std;
- int a=0;
- saber_prints(string x=""){
- cout<<x;
- }
- saber_printi(int x=0){
- cout<<x;
- }
- saber_endline(){
- cout<<endl;
- }
- class saber_int
- {
- public:
- int value;
- };
- #endif
- A cpp file:-
- #include "saber.hpp"
- int main()
- {
- saber_prints("Hello\nEnter the first number : ");
- saber_int num1;
- saber_int num2;
- cin>>num1.value;
- saber_prints("Enter the second number : ");
- cin>>num2.value;
- saber_endline();
- saber_prints("The sum = ");
- saber_printi(num1.value+num2.value);
- }
Advertisement
Add Comment
Please, Sign In to add comment