0% found this document useful (0 votes)
7 views6 pages

Lab Manual G07-1

The document is a lab manual for a 'Programming Fundamentals' course at the University of Engineering and Technology Lahore, Narowal. It includes instructions for installing Dev C++ and writing basic C++ programs to print text and shapes. The manual is structured with objectives, tasks, and code examples for each lab session.

Uploaded by

adanzahra19
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views6 pages

Lab Manual G07-1

The document is a lab manual for a 'Programming Fundamentals' course at the University of Engineering and Technology Lahore, Narowal. It includes instructions for installing Dev C++ and writing basic C++ programs to print text and shapes. The manual is structured with objectives, tasks, and code examples for each lab session.

Uploaded by

adanzahra19
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 6

UNIVERSITY OF ENGINEERING AND

TECHNOLOGY LAHORE, NAROWAL

Lab Manual
“Programming Fundamentals”

Submitted By: (Group - 07)


Umar Farooq- 2024-EE-635

Saad Jamil - 2024-EE-616

Rameen Fatima - 2024-EE-653

Adan Zahra- 2024-EE-615

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

Download & Install Instructions


Figure 1. 1: Downloaded Dev-C++ ............................................................................................................. 3
Figure 1. 2: Install Dev C++........................................................................................................................ 4
Figure 1. 3: Complete Installation ............................................................................................................... 4

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.

Lab 1: How to Install Dev C++


Objective:
Learn how to install and set up Dev C++ to write and execute C++
programs. Figure 1: Dev-C++

Instructions:
1. Download Dev C++
o Visit the official website: https://sourceforge.net or https://

o Click on the "Download" button to start downloading the installer.

Figure 1. 1: Downloaded Dev-C++

2. Install Dev C++


o Locate the downloaded file (usually in your Downloads folder).

o Double-click the installer to begin the installation process.

o Follow the on-screen instructions:

▪ Select your preferred language.

3
Programming Fundamentals | Lab Manual

▪ Agree to the license agreement.

▪ Choose the installation directory (default is recommended).

▪ Select the components you wish to install (default options are fine).

Figure 1. 2: Install Dev C++

3. Complete Installation:
o Click "Install" and wait for the installation process to complete.

o Once completed, click "Finish" to exit the installer.

Figure 1. 3: Complete Installation

4. Open Dev C++


o Launch Dev C++ from the Start menu or desktop shortcut.

o Go to "File" > "New" > "Source File" to start coding.

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.

Lab 2: Basic Output in C++


Objective: Learn to write and execute basic C++ programs to print text and shapes.

Task 1: Print "Hello, World!"


Steps:

1. Open Dev C++ and create a new source file:


a. Go to "File" > "New" > "Source File."
2. Write the following code:

1. #include <iostream>
2. using namespace std;

3. int main() {
4. cout << "Hello, World!" << endl;
5. return 0;
6. }

Figure 2. 1: Task 01: Code

a. Save the file with a .cpp extension (e.g., hello_world.cpp).


3. Compile and run the program:

5
Programming Fundamentals | Lab Manual

a. Click on the "Execute" menu and select "Compile and Run."


b. The output should display: Hello, World!

Output 1

Task 2: Print Shapes (Box, Diamond, Oval, and Arrow)


Steps:

1. Write a program to print the following shapes using cout:

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. }

Figure 2. 2: Task 02: Code

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

You might also like