Reading out my answer

Hello.


I'm learning c++ just for leisure
As i was building my code, i came across a problem.

How am i able to portray my answer when i run it?

What is the source of information that i am missing to complete my program?


Do i need to use a string?
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
  #include <iostream>
#include <string>
using namespace std;

int main()

{

    int first_number;
    int second_number;



    {cout << "Enter first number you would divide from bruh: ";
    cin >> first_number;
    cout << "Enter second number you would wish to divide with: ";
    cin >> second_number;
    cout << first_number << " / " << second_number << " = " <<
    first_number / second_number << endl;


    string first_number;
    string second_number;
    string answer_number = first_number + " " + second_number;

    cout << "You answer is : " << answer_number << "\n";
    }


}
I don't understand, you already have the code you want on line 18+19.
Topic archived. No new replies allowed.