Exercise on C++ Basic I/O

  • Compile and run this C++ program.
  • Add code by declaring two more variables ch with data type char and num with data type float.
  • Change the code so that you are able to input an integer, a character, and a decimal number from the keyboard (i.e. You need to prompt the user input data from keyboard so that your input is user interactive.) and then print them out to the screen.The output should looks like the following:
    Please enter an integer number: 35
    You entered: 35
    Please enter a character: f
    You entered: f
    Please enter a float number: 45.234
    You entered: 45.234
  • Compile and run this C++ program.
  • Perform a screen capture of the program output: lab3-2.doc Show this to to your lab instructor.

    This page last modified:
    Thursday, 06-Oct-2011 12:13:32 CST
    Accessed     times.

    Copyright: Department of Computer Science, University of Regina.