LAB REPORT
_____________________________________________________________________________
Programming Fundamental Lab
CS-102L
BS Robotics & Automation
Submitted By
Rashna Nadeem
24-RA-015
Section: RA – 01
Department of Electrical Engineering
HITEC University
Heavy Industries Taxila Education City
Lab # 01
Installation of Dev C++ and Fundamentals of a Sample C++ Program
Learning Objectives
The objectives of this first experiment are: 1. To familiarize you with the Windows
programming environment and the "C++" compiler. For this purpose, you will use Dev C++.
You will write, compile, and run a program in "C++".
Equipment and Components
Dev-C++ 5.0 Beta 9.2 (4.9.9.2)
Introduction to C++
C++ is a widely used, high-level programming language that enhances the capabilities of the
C language by introducing object-oriented programming features. It was developed by
Bjarne Stroustrup in the early 1980s and has since become a cornerstone in software
development, game programming, and systems programming due to its efficiency and
flexibility. C++ allows developers to create complex applications with a focus on
performance and resource management.
Lab Tasks
Task 1: Identify and Discuss Errors in the Following Codes
Part A.
Errors Identified:
1. Missing semicolon after using namespace std.
Page | 2
2. Incorrect declaration of main function; it should not have a semicolon.
3. Hello! should be enclosed in double-quotes.
4. The string ” Enjoy yourself with, “ uses incorrect quotation marks; it should use
standard double quotes.
5. Missing semicolon after cout<<” Enjoy yourself with, “.
6. The return value of the main should typically be 0 for successful execution.
Corrected Code
Output
Part B.
Page | 3
Errors Identified:
1. The string ”\n” uses incorrect quotation marks; it should use standard double quotes.
Corrected Code
Output
Part C.
Errors Identified
1. No errors in the code, but the commented line will not produce any output.
Page | 4
Output
Task 2: Write a C++ Program that Prints the Following Output on the Screen
Desired Output:
C++ Program
Output
Conclusion
Page | 5
In this lab, we successfully installed Dev C++ and learned to identify and correct common
syntax errors in C++ code. We also practiced writing a simple program that outputs a
specified text. This foundational knowledge is essential for further exploration and
development in C++. Understanding the structure of a C++ program, including the use of
libraries, functions, and output statements, will serve as a basis for more complex
programming tasks in the future.
Marks Distribution:
Presentation(Format(0.5)+Title(0.5)+ Calculations Observation
/Coding /Program Total
Conclusion(1)+Theory (2)
Results
+Observation(1))
5 5 5 15
Total
Obtained
Lab Instructor
Total Marks:
Marks Obtained:
Page | 6