cin>> is used to take value from the user. cout<< is used to print value. #include <iostream> using namespace std; int main() { int no; cout << "Enter an integer value: "; cin >> no; cout << "You entered " << no; return 0; } OutPut Enter an integer value: 23 You entered 23
-
-
Here, printf() is used to display text on the screen. The sign & is used to assign the input value to the variable and store it at that particular location. scanf() is used to take input from the user using format specifier. %d and %i, both are used to take integer numbers as input from the user. %f is the format specifier to take float as input from the user. %c is the format specifier to take character as input from the user. %s is the format specifier to take string as input from the user but %s cannot get string with white space from user,…