Pages

Friday, March 21, 2025

calculate sum and product in C++

 #include<iostream>

#include<iomanip>
using namespace std;

int main() {
    int a;
    int b;

    //input a
    cout<<"Enter a : ";
    cin>>a;

    //input b
    cout<<"Enter b: ";
    cin>>b;

    //calculate sum
    int sum = a + b;
    int prod = a*b;
    cout<<"sum = "<<sum<<endl;
    cout<<"product = "<<prod<<endl;

    return 0;

}

No comments:

Post a Comment

how to become red on codeforces by Errichto Algorithms | explained simply in a blog

 Yes. I found an available transcript of the video and summarized it simply. The video is “How To Become Red Coder? (codeforces.com)” by Err...