What is CPP Programming Language?
CPP is programming language in which c has modified with objects and class. Means in C, there were no class and objects but when add it becomes C++ language.
There are data types like integer, float, character and boolean.When we have to print statement we will write cout when we have to take input we will write cin.
Conditional statements like if loop, if else loop, for loop, while loop, do while loop, switch case statement.
For Example:
int i=3;
if(i<=5){
cout<<“yes”<<endl;
}
else{
cout<<“no”<<endl;
}
output: yes
Class: Class is blueprint of object. we create a class using class keyword.
For Example:
class Room {
public:
double length;
double breadth;
double height;
double calculateArea(){
return length * breadth;
}
double calculateVolume(){
return length * breadth * height;
}
};