2. 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 | yogendra@learnbywatch.com
3. First C++ Program
• Write a program to print a line of text
on computer screen.
www.learnbywatch.com | yogendra@learnbywatch.com
4. Comments
• Single line comment
• Multiple line comment
www.learnbywatch.com | yogendra@learnbywatch.com
“Use comments to
document your source
code.”
//this is single line comment
/* this is
multiple line
comment */
5. C++ Program with variable(s)
• Write a c++ program that accept an
integer value and print it.
www.learnbywatch.com | yogendra@learnbywatch.com
6. 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.
www.learnbywatch.com | yogendra@learnbywatch.com
7. Ask your questions
to learn better
Yogendra Pal
www.learnbywatch.com | yogendra@learnbywatch.com