11th Computer Science 12th Computer Science BCA CBSE CBSE JAC JAC

Console Input Output in C++ with Example

Console Input Output in C++
Written by AIPS

In this tutorial we are going to learn console input output int C++ with example in very easy way.

Input through keyboard and output on the monitor/ screen is known as console input output.

To perform input /output operations , there are various functions.

console input / output can be divided into two categories.

  1. Unformatted input / output functions
  2. Formatted input / output functions

Unformatted input / output functions

It is mainly used for characters. No any control string is used.

Unformatted input functions

1. getch()

It takes entry of a single character. Entered key doesn’t display on the screen . It has defined in #include<conio.h> header file.

2. getche()

It takes a single character and very similar to getch( ). Entered character prints on the screen . It has defined in #include<conio.h> header file.

3. getchar()

It is used to take entry of single character form keyboard. It has defined in #include<stdio.h> header file.

4. gets()

It is used to take entry of a string(more than one words at a time) from the keyboard. It has defined in #include<stdio.h> header file.

Unformatted output functions

1. putch( )

It displays the character on the screen. It has defined in #include<conio.h> header file.

2. putchar( )

It displays the character on the screen. It has defined in #include<stdio..h> header file.

3.puts( )

It is used to display string on the monitor. It has defined in #include<stdio.h> header file.

About the author

AIPS

Leave a Comment