Basic of C++ language
C++ is a statically type compile general purpose case sensitive freeform programming language that support procedure object oriented and generic programming language.
C++ = Object oriented programming language
C = Procedure oriented programming language
C++ is regarded middle class language because is combination of high-level and low-level programming language.
C++ Was developed by Bjarne Stroustrup which is the father of C++.Starting in 1979 , Bell laboratory (labs).
C++ support has four (4) pillars of object oriented programming language.
Four pillars of C++ language :
- Encapsulation
- Data hiding
- Inheritance
- Polymorphism
Keyword used in C++ language
Auto
const
else
new
enum
break
switch
for
while
do
go to
int
long
float
private
pretected
public
return
short
true
void
cout
cin
What is Comments in C++
Proggrame comments are used to help any on reading the source code C++ support single line and and multiline comments.
Shortcut key used in C++
Compile = Alt+9
Run = ctrl+F9
Output = Alt+F5
What is Data types :
While writing a progrrame in any language we need to used various variable to store various information variable re nothing but resort memory location to store values . this means that when a create a variable to resort when space in memory.
Type Keyword
Character Char
Integer int
Floating float
Double Floating double
Some example of C++ programme
- Write a C++ programme to Display "Hello World"
#include <iostream.h>
int main()
{
cout<<"Hello World";
return 0;
}
Output
Hello World
- Write a C++ programme to Add two Number.
#include <iostream.h>
int main()
{
int x,y,z;
cout<<"enter the value of x and y";
cin >>x>>y
z=x+y;
cout<<"the result of z is "<<z;
}
- Write a C++ programme to display Days of week.
#include<iostream.h>
int main()
{
cout<<"Sunday";
cout<<"Monday";
cout<<"Tuesday";
cout<<"Wednesday";
cout<<"Thursday";
cout<<"Friday";
cout<<"Saturday";
return o;
}
Out put
Sunday
Monday
Tuesday
Wednesday
Thursday
Friday
Saturday
Read also: All computer full forms , Computer course related Full forms.
Read also: Types of computer and Classification of computer, 3 three types of computer.
Read also: Generation of computer , First generation to Fifth generation of computer, CPU, UPS, IT full form.