Basic Need To Know To Start

Basic Need To Know To Start


C++ is a type of programming language, developed by Bjarne Stroustrup.


Cout and Cin


cout in C++, is similar to printf in C. cout is used to display some message on the screen. cout can be used as: 

cout<<”Hello World”; 

This statement will display the message “Hello World” on the screen.

cin in C++, is similar to scanf in C. cin is used to take input the value of some variable from the user. cin can be used as:

cin>>x;

This statement can be used to take input the value of some variable x from the user. The data type of x can be int, float, char etc. There is no format specifier %d, %f, %c in cin (although format specifier was present in scanf).

We have to use the header file iostream.h, for cout and cin.

The first basic Programs to be seen is below :-


#include<iostream.h>
#include<conio.h>
void main()
{
cout<<”Hello World”;
}

Output:
Hello World


The above is the input and output purpose and its code by the simple process and will be easy to do .






Comments

Popular posts from this blog

Inline and Friend Operators

Function overloading and Operator overloading

Exceptional Handling