C++ OOP Lecture03 IntroductionToC++
C++ OOP Lecture03 IntroductionToC++
To know about:
History of C++
C++ coding environment
Writing first code in C++
Basic syntax of C++
History of C++
3
#include<iostream>
using namespace std;
int main(){
int a;
cin>>a;
cout<<"The number is : ";
cout<<a;
}
Basic Syntax of C++
7
Instructs the preprocessor to
#include<iostream> include a section of standard
C++ code, known as header
using namespace std; iostream, that allows to
perform standard input and
output operations.
#include<iostream>
using namespace std;
cin is a predefined object
that represents the standard
input stream. In C++
int main(){ >> is called extraction or
get from operator which
extracts the value from the
keyboard and assign it to the
int a; variable on its right
cin>>a;
cout<<"The number is : "; cout is a predefined object
that represents the standard
cout<<a; output stream. In C++
<< is called insertion or
put to operator which
inserts the contents of the
} variable on its right to the
object on its left
9
THANK YOU