GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing www.dremendo.com — cin Statement and its Use in C++ Program | Dremendo
?>
Announcements
No new announcements.
C++ Programming Tutorial
Table of Contents
cin Statement and its Use in C++ ProgramIn this lesson, we will look at what is cin statement in C++ programming and how it works along with some example. What is cin StatementThe cin statement in C++ is used for input operations. It is part of the standard input/output stream library, which allows program to read input from the standard input device, typically the keyboard. The cin is defined in the <iostream> header file.
Video Explanation
Click the button below to watch the explanation.
Please wait while the video is loading....
Let's see an example of how to use cin to read different types of data from the keyboard.
Example
Output
What Happens in the Example
Enter your age: 15 Enter your height in meters: 3.423 Enter your weight in kilogram: 45.21543 Enter the first character of your name: R You entered: Age: 15 Height: 3.42 meters Weight: 45.22 kilogram Initial: R
Note
The >> is called the Extraction Operator, which is used with the cin statement to extract or read data from an input stream, such as the keyboard. Handling Multiple Inputs in a Single cin StatementWe can read multiple values in a single cin call by using multiple extraction operator >>. Here is an example given below:
Example
Output
Enter three integer numbers, one float and one double type number: 45 95 78 12.33 8.62143624 You entered: 1st number: 45 2nd number: 95 3rd number: 78 4th number: 12.33 5th number: 8.62143624 Test Your KnowledgeAttempt the questions in the exercise to check whether you have understood the lesson clearly.
We care about your privacyDremendo uses cookies and similar technologies that are necessary for the site to work properly, understand how you interact with our website, and measure the effectiveness of our marketing. By clicking Accept All, you consent to the use of non-essential cookies and similar technologies for analytics, advertising, and ad measurement, as described in our Privacy Policy. Cookie PreferencesChoose which types of cookies Dremendo may use.
Necessary Cookies
Allow
Required for essential website functionality and security.
Analytics Cookies
Allow
Help us understand how visitors use Dremendo.
Marketing Cookies
Allow
Help us measure advertising performance and understand interactions with our advertisements.
Mentora
Question Asked: 0 / 20
Hi, I’m Mentora! I’m your personal AI tutor from Dremendo. Ask me anything, and I’ll help you understand it in a simple and easy way. |
| You are visitor 01402503 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |