C++ Program Read Data From Keyboard
Write C++ Program to Read Data from Keyboard
// C++ Program To Use cin() And cout() Functions #include<bits/stdc++.h> using namespace std; int main() { int a; float b; char c; // Display message to console cout << "Enter the Decimal Number :--> "; cin >> a; //Read from keyboard cout << "Enter the Floating Point Number :--> "; cin>> b; //Read from keyboard cout << "Enter the Character :--> "; cin >> c; // Read from keyboard // Display values stored in the variable cout << "\nThe Decimal Number is : "<< a; cout << "\nThe Floating Point Number is : " << b; cout <<"\nThe Character is : " << c; return 0; }
Output:
Enter the Decimal Number :--> 45
Enter the Floating Point Number :--> 56.67
Enter the Character :--> M
The Decimal Number is : 45
The Floating Point Number is : 56.67
The Character is : M