TestingDocs.com
Software Testing website
  • Automation
    • Selenium
    • JBehave Framework
  • Tutorials
    • MySQL Tutorials
    • Testlink
    • Maven
    • Git
  • IDEs
    • IntelliJ IDEA
    • Eclipse
  • Flowcharts
    • Flowgorithm
    • Raptor
  • About

C++

C++ Output Statement

Overview

In this tutorial, we will learn the C++ output statement with the help of a sample program. The basic output object to display output to the standard output device is the cout object.

C++ Output Statement

We use the cout output object and the << operator to display the output to the standard output device. The C++ standard output device is the monitor.

For example, to display a string, we can use the following statement

cout << “Hello World!”;

C++ Program

We will write a simple C++ program to understand the concept. We will write a simple program to display output to the standard output device i.e monitor screen.

/************************************
* C++ Output
* Filename: output.cpp
* Program to display output to standard
* output device i.e monitor screen.
* C++ Tutorials – www.TestingDocs.com
**************************************/
#include
using namespace std;
int main()
{
int num; //declare integer variable
cout << “Enter integer input:”; // User prompt
cin >> num; // C++ Input Statement
cout << “The value is =:” << num << endl;

return 0;
} // end main

Sample Output

Enter integer input:79
The value is =:79

 

—

C++ Tutorials

C++ Tutorials on this website:

https://www.testingdocs.com/c-coding-tutorials/

For more information on the current ISO C++ standard

https://isocpp.org/std/the-standard

 

Related Posts

g not found OpenSuse

C++ /

Install GCC C++ Compiler on OpenSuse

sum of digits c program

C++ /

Sum of Digits of a Number C++ Program

C++ Hello World Program

C++ /

C++ Hello World Program

C++ /

Object-Oriented Programming Language Examples

C++ /

Object-Oriented Programming Features

‹ C++ Input Statement› C++ Program to Compute Circumference of a Circle

Recent Posts

  • MS Access Data Types
  • Install RAPTOR Avalonia on CentOS
  • Download RAPTOR Avalonia Edition on Windows
  • npm doctor command
  • Build & Run CLion Project
  • Create New CLion C Project on Windows
  • Configure CLion Toolchains on Windows
  • Launch CLion IDE on Windows
  • Activate CLion IDE
  • CLion IDE for C/C++ Development

Back to Top

Links

  • Contact
  • Privacy Policy
  • Cookie Policy

www.TestingDocs.com

Go to mobile version