C++ Standard Input Question, Multiple Inputs

Introduction

Write a program that accepts three values of type char, int, and double respectfully from the standard input.

Print out the values afterward.

You can use the following code structure.

#include <iostream> 

int main() 
{ 
    //your code here
}



#include <iostream> 

int main() 
{ 
    std::cout << "Please enter a char, an int and a double: "; 
    char c; 
    int x; 
    double d; 
    std::cin >> c >> x >> d; 
    std::cout << "You entered: " << c << ", " << x << ", and " << d; 
} 



PreviousNext

Related