+ 2
How to use input/output in C++?
What is the scanf() and printf() from C in C++?
5 Answers
+ 9
Everybody had given a decent answer, this is just a little additional resources;
https://fresh2refresh.com/c-programming/c-printf-and-scanf/
http://www.cplusplus.com/reference/cstdio/scanf/
http://www.cplusplus.com/reference/cstdio/printf/
+ 7
Provided cstdio is included, both scanf() and printf() can be used in conventional C++ compilers but not in Code Playground
You can also use std::cout and std::cin objects of iostream in C++ for output and input, respectively
Learn more: https://www.sololearn.com/Course/CPlusPlus/?ref=app
+ 6
std::cin>>variable;
std::cout<<something;
are most common
+ 4
Example-
cout << "Enter your age:";
cin >> age;
cout << "\nYour age is: "<<age;
+ 1
I always input using namespace std; it helps by making it so I don't need to type std over and over again. But I using cout and cin is good, you can add if functions for the cin, or just use cout<<a; while a is your answer.