1 Introduction To Programming
1 Introduction To Programming
C++
What is a computer language?
#include<iostream.h>
#include<conio.h>
Void main(void)
{
Cout<<“hello world”;
Getch();
}
Structure of a c++ program
Example #02
#include<iostream.h>
#include<conio.h>
void main(void)
{
cout<<“ C++ is a powerful programming language”;
cout<<“UNIX operating system is written in C++”;
cout<<“please pay great attention to learn the language”;
getch();
}
• Use of endl manipulator and clrscr() function.
Example #03
#include<iostream.h>
#include<conio.h>
void main(void)
{
cout<<“ C++ is a powerful programming language”<<endl;
cout<<“UNIX operating system is written in C++”<<endl;
cout<<“please pay great attention to learn the language”<<endl;
getch();
}
• Using three “put to” or insertion operators.
Example #04
#include<iostream.h>
#include<conio.h>
void main(void)
{
cout<<“ I “<<“LOVE”<<“ PAKISTAN ”;
getch();
}
Use of Escape Sequence
– Use of Comments