Welcome To The World Of Hacking


Learn Hacking|Teach Hacking|Learn To Secure|Learn To Code

Tuesday

C++ TUTORIAL 4: USER INPUT

#include <iostream>
using namespace std;

int main()
{
    int a;
    int b;
    int addition;
    int subtraction;

    cout<<"Enter a number :\n";
    cin>>a;
    cout<<"Enter another number :\n";
    cin>>b;

    addition = a + b;
    cout<<"Addition of a and b :"<<addition<<endl;
    subtraction = a - b;
    cout<<"Subtraction of b from a :"<<subtraction<<endl;

    return 0;
}

OUTPUT:


No comments:

Post a Comment

Related Posts Plugin for WordPress, Blogger...