In: Computer Science
Write a program that prints out your name, the course ID of this class, what programming/computer courses you've taken.
Ask the user for two numbers.
Show the sum of the two numbers, the difference, the product and the quotient.
For the difference subtract the second number from the first, for the quotient, use the first number as the numerator(dividend) and the second as the denominator(divisor).
Sample Output:
My name is Jianan Liu, I'm in course CS36. I've taken:
C Programming
C++ Programming
Give me a number: 7
Give me a second number: 2
The sum is 9.
The difference is 5.
The product is 14.
The quotient is 3.
#include <iostream>
using namespace std;
int main() {
int a, b;
cout<<"My name is Jianan Liu, I'm in course CS36. I've taken"<<endl;
cout<<"C Programming"<<endl;
cout<<"C++ Programming"<<endl;
cout<<"Give me a number: ";
cin>>a;
cout<<"Give me a second number: ";
cin>>b;
cout<<"The sum is "<<a+b<<"."<<endl;
cout<<"The difference is "<<a-b<<"."<<endl;
cout<<"The prodict is "<<a*b<<"."<<endl;
cout<<"The quotient is "<<a/b<<"."<<endl;
}
=============================================================
SEE OUTPUT
Thanks, PLEASE COMMENT if there is any
concern.