Lab Manual G07-1
Lab Manual G07-1
Lab Manual
“Programming Fundamentals”
Submitted To:
Engr. Amna Javeed
Programming Fundamentals | Lab Manual
Table of Contents
Lab 1: How to Install Dev C++ ................................................................................................................... 3
Objective .................................................................................................................................................. 3
Instructions ............................................................................................................................................... 3
Lab 2: Basic Output in C++ ........................................................................................................................ 5
Task 1: Print "Hello, World!".................................................................................................................. 5
Task 2: Print Shapes (Box, Diamond, Oval, and Arrow) ....................................................................... 6
Table of Figures
Figure 1: Dev-C++....................................................................................................................................... 3
Task Codes
Figure 2. 1: Task 01: Code .......................................................................................................................... 5
Figure 2. 2: Task 02: Code .......................................................................................................................... 6
Task Outputs
Output 1 ................................................................................................... Error! Bookmark not defined.
Output 2 ...................................................................................................................................................... 6
2
Programming Fundamentals | Lab Manual
Lab No.
Instructions:
1. Download Dev C++
o Visit the official website: https://sourceforge.net or https://
3
Programming Fundamentals | Lab Manual
▪ Select the components you wish to install (default options are fine).
3. Complete Installation:
o Click "Install" and wait for the installation process to complete.
5. Verify Installation:
o Write a simple C++ program to print "Hello, World!" and run it to ensure the setup
works (refer to Lab 2 for instructions).
4
Programming Fundamentals | Lab Manual
Lab No.
1. #include <iostream>
2. using namespace std;
3. int main() {
4. cout << "Hello, World!" << endl;
5. return 0;
6. }
5
Programming Fundamentals | Lab Manual
Output 1
1. #include <iostream>
2. using namespace std;
3. int main()
4. {
5. cout << "Box
\n*********\n*\t*\n*\t*\n*\t*\n*\t*\n*\t*\n*\t*\n*********"<<endl;
6. cout << "Oval\n *** \n * * \n* *\n * *
\n *** \n"<<endl;
7. cout <<
"Arrow\n * \n ***\n *****\n *\n *\n *\n *\n
*\n *\n"<<endl;
8. cout << "Diamond\n * \n *
* \n * * \n * * \n * * \n *
* \n * \n";
9. }
2. Save each program with a unique name (e.g., square.cpp, diamond.cpp, etc.).
3. Compile and run each program to see the shapes printed in the output window.
Output 2