c++ training institute in ambala ! batra computer centre
TRANSCRIPT
Website: www.batracomputercentre.comPh. No.: 8222066670, 4000670
Email: [email protected] COMPUTER CENTREISO CERTIFIED 9001:2008
C++ Training
in Ambala
Website: www.batracomputercentre.comPh. No.: 8222066670, 4000670
Email: [email protected]
Basic Structure of C++ Programming
Website: www.batracomputercentre.comPh. No.: 8222066670, 4000670
Email: [email protected]
Basic Structure of C++ Programming
#include<iostream>Using namspace std;int main(){
Program code will be written here
return 0;}
Website: www.batracomputercentre.comPh. No.: 8222066670, 4000670
Email: [email protected]
#include<iostream>
## is called preprocessor directive
PreprocessingPreprocessing is the phase of compilation before the actual execution.
Website: www.batracomputercentre.comPh. No.: 8222066670, 4000670
Email: [email protected]
#include<iostream>
These are the header files inclusion statement
Header FilesHeader files are the predefined files in the C++ library using which we create new program.
Website: www.batracomputercentre.comPh. No.: 8222066670, 4000670
Email: [email protected]
int main()
This is the main() method/function of a C++ program. Actual execution of a program starts from method.
Website: www.batracomputercentre.comPh. No.: 8222066670, 4000670
Email: [email protected]
First C++ Program#include<iostream>Using namespace std;Int main(){Cout<<“My First C++ Program\n”;Int x = 10;Cout<<“x = “<<x<<endl;Cout<<“x = “;Cin>>x;Cout<<“x = “<<x<<endl;Return 0 ;}
Website: www.batracomputercentre.comPh. No.: 8222066670, 4000670
Email: [email protected]
iostream
Iostream stands for Input Output Stream
It contains functions related to input and output.
For ex:- cout,cin etc.
Website: www.batracomputercentre.comPh. No.: 8222066670, 4000670
Email: [email protected]
Cout<<“ text to be display”;
Define Within iostream
The text written within double quotes(“ “) will got
displayed on the output screen as it is.
Website: www.batracomputercentre.comPh. No.: 8222066670, 4000670
Email: [email protected]
Cin>>variable_name;
Define Within iostream
It takes input values from the user
Website: www.batracomputercentre.comPh. No.: 8222066670, 4000670
Email: [email protected]
Rules of C++ Language
Every program should have main()
Every statement should be end with semicolon(;)
This Language is case sensitive
All the letter should be in lowercase.
Website: www.batracomputercentre.comPh. No.: 8222066670, 4000670
Email: [email protected]
Escape sequences
\n – New Line \0 – Null
\t – Horizontal tab
// - \
/’ – ‘
/” – “
Website: www.batracomputercentre.comPh. No.: 8222066670, 4000670
Email: [email protected]
Comments in a C++ Program
Comments are used to increase understandability and
readability of program. These comments will be
ignored by the compiler at the time of
compilation/execution.
i.e. comments are part of a program but not the part
of compiled/executed code.
Website: www.batracomputercentre.comPh. No.: 8222066670, 4000670
Email: [email protected]
Type of comments
Single Line Comments Starts with // and treats all the contents
following // as comments within that line
Multiple Line Comments Starts with /* and end with */ and all the contents
in between will be treated as comments
Website: www.batracomputercentre.comPh. No.: 8222066670, 4000670
Email: [email protected]
Comments Usage Example/* Title:- My First C++ ProgramCreated By:- XYZ#include<iostream>#include<conio.h>Int main(){Clrscr(); // to clear the output screenCout<<“My First C++ Program”;Getch();Return 0 ; //to pause the final output}
Website: www.batracomputercentre.comPh. No.: 8222066670, 4000670
Email: [email protected]
ADDRESS:
SCO -15, Dayal Bagh,
Near Hanuman Mandir
Ambala Cantt-13300, Haryana
Ph. No.: 9729666670, 8222066670 &0171-4000670
Email ID: [email protected]
Website: www.batracomputercentre.com