Upload
learn-by-watch
View
313
Download
1
Embed Size (px)
Citation preview
Yogi’s Guide to
C++Yogi’s Guide
toC++
First C++ ProgramYogendra Pal
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.
www.learnbywatch.com | [email protected]
First C++ Program• Write a program to print a line of text
on computer screen.
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 */
www.learnbywatch.com | [email protected]
C++ Program with variable(s)• Write a c++ program that accept an
integer value and print it.
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.
Yogi’s Guide to
C++Yogi’s Guide
toC++
Ask your questionsto learn better
Yogendra Pal
www.learnbywatch.com | [email protected]