Hi,

i'm making a program that outputs a lot of questions at 1 time.

.... ??
.... ??
.... ??

and i want write the answers in front of the questions and input it in the same order...

that would be like

How are you? and i write the answer here
How old are you? and here
What's your name? and here

waiting for help
thank you

P.S. i'm new here, nice forum...

#include <iostream>
#include <string>

using namespace std;

int main()
{
    string answer;

    cout << "This is a question? ";
    cin >> answer;
    
    system("PAUSE");
    return(0);
}

As I know you can't do that. One question, then the answer.

Huh? What's that good for?

#include <iostream>
#include <string>

using namespace std;

int main()
{
    string answer;

    cout << "This is a question? ";
    cin >> answer;
    
    system("PAUSE");
    return(0);
}
#include <iostream>
#include <string>

using namespace std;

int main()
{
    string answer;

    cout << "This is a question? ";
    cin >> answer;
    
    system("PAUSE");
    return(0);
}

i want output many questions and AFTER that give the answers in front of questions...

i want output many questions and AFTER that give the answers in front of questions...

That's what I said. :)

You could do that if you were using a forms window or similar. On the console you could use the set position functions like so Set console window cursor position

These idea's may or may not be what your looking for but its all i can think of. Good luck :)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.