+ 1
How to display two results on the screen?
Advanced and experienced programmers, I need your help regarding c. My question is about c++, I am a beginner in this, and I would like to know if it is possible to generate a code that performs two operations and shows them on the screen, what I try to do (to be clearer) is to make a code that can multiply two fractions, and I understand that you need to multiply the first numerator with the second to obtain the result of the numerator, and multiply the first denominator by the second denominator to obtain the new denominator. I have everything I have understood, but I need to know how it is done so that those two results (of numerator and denominator) can be shown on the screen.
2 Antworten
+ 1
int n1,n2,d1,d2;
cin >> n1;
cin >> d1;
cin >> n2;
cin >> d2;
cout << n1*n2 << "/" << d1*d2 << endl;
+ 1
You can use cout
If you haven't done this tutorial, you should do it first.