confused

im a little confused as to why rewriting the following code instead of the double cout i have why it will not let me just add a "cout <<"blahblah" result;"
im new at programming and just trying to understand the logic here....ty for any help
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#include <iostream>

using namespace std;

int main()
{
    int
    a(5),
    b(3),
    result;

    result=a-b;
    cout <<"5-3=";
    cout <<result;

    cin.get();
    return 0;
}
Last edited on
you're going to display the value of result not the word result
you can also use this
cout<<a<<" - "<<b<<" = "<<result;
O.o...thank you so much!
Topic archived. No new replies allowed.