first cpp program
TRANSCRIPT
![Page 1: First cpp program](https://reader036.vdocuments.mx/reader036/viewer/2022070514/587cba441a28ab38028b66c9/html5/thumbnails/1.jpg)
Yogi’s Guide to
C++Yogi’s Guide
toC++
First C++ ProgramYogendra Pal
![Page 2: First cpp program](https://reader036.vdocuments.mx/reader036/viewer/2022070514/587cba441a28ab38028b66c9/html5/thumbnails/2.jpg)
www.learnbywatch.com | [email protected]
At the end of this tutorial you will be able to• Explain and write the minimal skeleton of C++ program.
• Write C++ programs without classes.
• Use cin and cout.
• Use comments in C++ programs.
• Use Code::Blocks IDE to write, compile and run C++ programs.
![Page 3: First cpp program](https://reader036.vdocuments.mx/reader036/viewer/2022070514/587cba441a28ab38028b66c9/html5/thumbnails/3.jpg)
www.learnbywatch.com | [email protected]
First C++ Program• Write a program to print a line of text
on computer screen.
![Page 4: First cpp program](https://reader036.vdocuments.mx/reader036/viewer/2022070514/587cba441a28ab38028b66c9/html5/thumbnails/4.jpg)
www.learnbywatch.com | [email protected]
Comments• Single line comment
• Multiple line comment
“Use comments to document your source
code.”
//this is single line comment
/* this is multiple line comment */
![Page 5: First cpp program](https://reader036.vdocuments.mx/reader036/viewer/2022070514/587cba441a28ab38028b66c9/html5/thumbnails/5.jpg)
www.learnbywatch.com | [email protected]
C++ Program with variable(s)• Write a c++ program that accept an
integer value and print it.
![Page 6: First cpp program](https://reader036.vdocuments.mx/reader036/viewer/2022070514/587cba441a28ab38028b66c9/html5/thumbnails/6.jpg)
www.learnbywatch.com | [email protected]
cin and cout• << is known as output operator when used with cout
• >> is known as input operator when used with cin
• << and >> operators can handle any C++’s data types.
• In a single cin statement we can use more than one variable.
• In a single cout statement you can print many variables and constants.
![Page 7: First cpp program](https://reader036.vdocuments.mx/reader036/viewer/2022070514/587cba441a28ab38028b66c9/html5/thumbnails/7.jpg)
Yogi’s Guide to
C++Yogi’s Guide
toC++
Ask your questionsto learn better
Yogendra Pal
www.learnbywatch.com | [email protected]