How to input a character in Dev C++ code example

Example 1: input a string in c++

string fullName;
cout << "Type your full name: ";
getline (cin, fullName);
cout << "Your name is: " << fullName;

Example 2: C++ user input

int x; 
cout << "hurry, give me a number!: "; // Type a number and press enter
cin >> x; // Get user input from the keyboard
cout << "you picked: " << x << " !" // Display the input value

OR use:
getline >> (cin, variable-name);
instead of 
cin >> x;

Example 3: how to get input in cpp

// i/o example

#include <iostream>
using namespace std;

int main ()
{
  int i;
  cout << "Please enter an integer value: ";
  cin >> i;
  cout << "The value you entered is " << i;
  return 0;
}

Tags:

Cpp Example