e6390af40fd246928c9f6b67562cf0fa37712fa8

8/20/2017

How To Use cout and cin in the c++ programming

In this post we will discus how to create a simple cout and cin  source code in c programming language.
In the c++ programming language the cout is used to display any message do you want to display as an output. The cin is used to take input from the user at required points.

How to use cout?


The word cout pronounce as c out and these are taken as c  from the c++ programming language and out from input  (standard output stream). The word cout is used to display or show the data do you want to display.In the console screen the message is displayed which you write on the cout  double "".The compiler move forward and read next line in source code after reading it.The source code of cout statement is given bellow.

#include<iostream>
using namespace std;
int main()
{
cout<<"  Hello Guys "<<endl;
        cout<<" This is you4c.blogspot.com "<<endl;

      return 0;
}

How to use cin?
The word cin pronounce as c in and these are taken as c  from the c++ programming language and in from input  (standard input stream). The word cin is used to take input from the user using keyboard.In the console screen their is a _ cursor that is blinking to take input from the user.When the user give input and press enter then the compiler move forward and read next line in source code.The source code of cin statement is given bellow.

#include<iostream>
using namespace std;
int main()
{
         int num;

cout<<" Please Enter a Number. "<<endl;
        cin>>num;
        cout<<"You Enter This number."<<num<<endl;

      return 0;
}

No comments:

Post a Comment

Privacy Policy for Apps

Privacy Policy Muhammad Shahbaz built the Health Physio Association app as a Free app. This SERVICE is provided by Muhammad Shahbaz at no...