Writing Simple Programs in C++
1.1. Objectives
The objectives of this lab are:
Learn basic structure of a C++ program
Understand how to compile, link and run a C++ program
1.2. Problem Analysis
(e.g. use of cout to display the text in console window.)
1.3. Tasks
Task 1: Use of cout to display a string.
Code:
(paste your code here)
Output
(Paste your output only. Donot paste any details of compiling etc.)
Task 2: Use of endl and special characters.
There are special characters in C++ that modifies the output of cout, some them are given
below,
character starts with ‘\’,
\n
\t
\\
\”
\’
Use cout , new line character \n, tab character \t and * to Produce The
Following Output
Code:
(paste your code here)
Output
(Paste your output only. Donot paste any details of compiling etc.)
Task 3: Display your data.
Display your data as
Code:
(paste your code here)
Output
(Paste your output only. Donot paste any details of compiling etc.)
1.4. Discussion & Conclusion.
(write and problem faced and its solution if any or any explanation of the lab)