Help with simple C++ program

Hi, i am pretty crude on C++ coding right now and i am close to 0 knowledge because i just dont get it, they're not clear enough for me.
my professor gave me this as homework. can someone plz explain me how do i complete it? pref with an example, Thank you!

these are the instructions: Write a simple program to capture a character and reprint it to the screen.

I have to do this with a Character, Whole number variable, Real number variable, and a String variable



#include <iostream>

int main() {
// declare a character

// prompt for input

// read the character

// print the character

return 0;
}
Last edited on
To get a character from the user, you use cin>>variable
To print a charactor on screen, you use cout << variable << endl;

Take a look at these good examples how a simple printout to screen can be
http://www.cplusplus.com/doc/tutorial/program_structure/

and this http://www.cplusplus.com/doc/tutorial/basic_io/ for input/output

Hope that gets you started
Topic archived. No new replies allowed.