c++ tutorial in telugu BUY TELUGU TUTORIAL DVD'S:::: SEO::3500/-,DCA(DOS,WINDOWS,WORD,EXCEL,POWER POINT, MS ACCESS, INTERNET CONCEPTS)::499/-,DTP(PHOTOSHOP,PAGEMAKER, CORELDRAW,TELUGU TYPING)::999/-,C::700,C++::900,TALLY ERP 9:: 999,ORACLE:999/-,CORE JAVA::1000/-,SPOKEN HINDI:500,HTML::500/-,AUTOCAD::2500/-,DCA+DTP::1000/-,DCA+TALLY::1000,C,C++,JAVA::1500, ALL COURSES(DCA,DTP,C,C++,JAVA,ORACLE,TALLY,HTML,SPOKEN HINDI,AUTOCAD):: 3500/-..CONTACT : SYED HAFIZ, SHOPPING COMPLEX,8INCLINE COLONY,GODAVARI KHANI,KARIMNAGAR, TELANGANA,CELL:9395306603,EMAIL:COOLHAFI7@GMAIL.COM.
Home / c++ / C++ tutorial in telugu using cin Part 3

C++ tutorial in telugu using cin Part 3

c++ tutorial in telugu

Standard input (cin)

In this tutorial we will take a look at basic input and output. Using the C++ iostream library we will get the user’s input from the keyboard and we will print messages onto the screen. The iostream library is part of the C++ standard library.

In C++, I/O is performed by using streams. A stream is a “stream of data” in which character sequences are “flow into” or “flow out off.” A stream is an object with properties that are defined by a class. Global objects are predefined for the standard I/O channels.

The header file iostream must be included to make use of the input/output (cin/cout) operators.

In most cases the standard input device is the keyboard. With the cin and >> operators it is possible to read input from the keyboard.

Take a look at an example:


	#include<iostream>
	using namespace std;

	int main()
	{
		char MY_CHAR;
		cout << "Press a character and press return: ";
		cin >> MY_CHAR;
		cout << MY_CHAR;
		return 0;
	}

Note: The input is processed by cin after the return key is pressed.

The cin operator will always return the variable type that you use with cin. So if you request an integer you will get an integer and so on. This can cause an error when the user of the program does not return the type that you are expecting. (Example: you ask for an integer and you get a string of characters.) Later on we will offer a solution to this problem.

The cin operator is also chainable. For example:


       cin >> XX >> YY;

In this case the user must give two input values, that are separated by any valid blank separator (tab, space or new-line).

That’s all for this tutorial.

 

About Hafiz

Check Also

C++ tutorial for beginners in telugu Part 1

c++ tutorial for beginners in telugu In this Video Tutorial you can learn c++ in …

Leave a Reply

Your email address will not be published. Required fields are marked *

STATE BANK OF HYDERABAD, ***NAME:Hafiz SD, BRANCH:JALLARAM, ACCOUNT.NO:62041435239, IFSC CODE:SBHY0020609,****, ANDRA BANK*** NAME:SYED HAFEEZ BABA, BRANCH:8INCLINE COLONY, ACCOUNT.NO:116710100037533****SBI****NAME:SYED HAFEEZ BABA,ACCOUNT NO:35321924009,IFSC CODE:SBIN0013338,BRANCH:GODAVARIKHANI.,...