Display problem

Now how do i cin the diff and display diff i get error missing argument and idetifier

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
  #include <iostream>
using namespace std;

int main()
{

    int lowno, highno, diff;
    cout << "Enter low: ";
    cin >> lowno;
    cout << "Enter highno: ";
    cin >> highno;
    cout << highno-lowno;
	cin >> diff;
	
	cout << "lowno:" << lowno << "\t\t" << "highno:" << highno << "diff:" << diff; endl;
    cout << "End Of Program" << endl;
    system("pause");
	    return 0;
}
line 15 - remove the ; after diff and put << before the endl;


line 13 - do you need the user to input the difference? it seems like you mean to calculate it for them.
Last edited on
how do i make the prog count the diff and display after ?
Replace line 12,13 with an assignment statement that assigns the value of highno - lowno to the variable diff. You've already got the code to get the numbers from the user before that, then the code to output the numbers entered and their difference afterwards.
God bless you thanks !
Topic archived. No new replies allowed.