Variables. Output specifiers




Let's try to write a calculator for primes

Our task is to display some arithmetic expression on the screen and make the computer count it.
For example, this:
5 + 7 = 12
Moreover, instead of 5 and 7, there may be different numbers, depending on the values ??of the variables a and b in the program.

In the output operator, you can output not just text, but also the values ??of variables, as well as the result of an arithmetic expression. Moreover, the output sequence may be different.

For example, you can output the above expression by writing:

cout << a << "+" << b << "=" << a + b;
If you want to output the value of a variable, then you just need to specify its name without quotes. If we want to output the result of an arithmetic expression, then it is enough to simply write the arithmetic expression correctly.

Note:
Variables, text and arithmetic expressions are separated from each other by the operator <<



*** Advanced material***
The number of output specifiers in the format string is not limited, the main thing for each qualifier is to list all the values ??that will be substituted for the template after the format string, by comma.
For example: printf("%d+%d=%d",a,b,a+b);
The format string indicates three qualifiers for displaying integer values ??instead. The substitution order is direct:  instead of the first template %d, the value of the variable a is displayed; instead of the second, the value of the variable b; and instead of the third, the value of the expression a + b

Now let's write a program that outputs the result of basic arithmetic operations with these variables

Task
Complete the given program so that in addition to the sum of numbers it displays the substraction, product and division in the corresponding lines.
The result of each operation must be displayed on a new line.
Do not forget to go to the new line, where necessary.
You should get the following:
10+5=15
10-5=5
10*5=50
10/5=2
C++
1
#include<iostream>       
2
using namespace std;       
3
main()       
4
{       
5
	 int a=10, b=5;             
6
	 cout<<a<<"+"<<b<<"="<<a+b<<endl;  // 10+5=15          
7
8
9
10
}       
Your last submission is saved in the editor window.
     

Results:

All results: