Solution:
As you know the cin operator achieves input in a variable. YOu can simply do this by cascading the cin operator in a single line. You were doing something like this
int a,b,c,d;
cout << "Enter value of a" << endl;
cin >> a;
cout << "Enter value of b" << endl;
cin >> b;
cout << "Enter value of c" << endl;
cin >> c;
cout << "Enter value of d" << endl;
cin >> d;
That’s the reason the program was asking for the inputs for each variable in a different line. You want to write something like this:
int a,b,c,d;
cout << "Enter the values of a,b,c, and d here: " << endl;
cin >> a >> b >> c >> d;
Now, the program will ask for all the inputs in a single line and print them in a single line too in the same way (if you want).
Thanks. Have a good day!