C++ Online Compiler
Example: C++ program to take inputs from the user
C
C++
C#
Java
Python
PHP
main.cpp
STDIN
Run
// C++ program to take inputs from the user #include <iostream> using namespace std; int main() { int p; float q; char r[1024]; cout << "Enter the integer value::\n"; cin >> p; cout << "Enter the float value::\n"; cin >> q; cout << "Enter the string value::\n"; cin >> r; cout << "\nThe integer input is:\n" << p << "\n"; cout << "\nThe float input is:\n" << q << "\n"; cout << "\nThe string input is:\n" << r << "\n"; return 0; }
5 7.5 hello
Output
Clear
ADVERTISEMENTS