Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
74 views

Lab Manual 1 (Code Blocks)

This document provides instructions for a programming lab on using the Turbo C++ compiler. The objectives are to understand how to use the Turbo compiler, run and compile a C program. It describes what an IDE is and recommends downloading the Code::Blocks IDE from the school's network. Sample tasks are given to write C++ statements to print patterns and personal information like name, ID, address and program details.

Uploaded by

Gul sher Baloch
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
74 views

Lab Manual 1 (Code Blocks)

This document provides instructions for a programming lab on using the Turbo C++ compiler. The objectives are to understand how to use the Turbo compiler, run and compile a C program. It describes what an IDE is and recommends downloading the Code::Blocks IDE from the school's network. Sample tasks are given to write C++ statements to print patterns and personal information like name, ID, address and program details.

Uploaded by

Gul sher Baloch
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 20

Programming Fundamental

Lab Manual (Lab 1)

Topic: What is Turbo Compiler


Course Instructor: Sir Arslan Asif
Lab Engineer: Ammar Yasir & Ubaid ur
Rehman

Semester: Fall 2015

School of Systems and Technology


UMT Lahore Pakistan
Objective:
The objective of the lab is to understand how to use the turbo compiler and how to run and
compile a C program. At the end of this lab learn how to use turbo compiler.

What is IDE?

IDE stands for integrated development environment. It is a software application that provides
comprehensive facilities to computer programmers for software development. An IDE normally
consists of a source code editor, build automation tools and a debugger

There are number of IDEs available for compilation of C/C++ code, here we use Code Block.
It is easily available on net. Following are some links from you may download it:

While you are in UMT you may copy it from the following network link.

\\punjab\Software\07 - Programinig & Development\01 - C & C++\05 - CodeBlock

Visit IPC Lab. Logon to your student account and type \\punjab command in “Run” in Windows
and browse to the specific folder (path given below).

Software
Programming & Development
C & C++
Code Block
Sample Lab Tasks
Sample Lab Task 1

How to install code blocks


1- First go to search bar at the left corner of windows in IPC and type
Enter
2- A dialogue box will appear of this kind
3-Then double click on the folder and Development
4-Now go to number 01- C and C++
5-Now click on number 05-Code Blocks
6-Now Copy the setup with name (codeblocks-13.12mingw-setup-TDM-GCC GCC-481)
7-After the Setup is copied run it, a dialogue box will appear click on Next.
8-Now click on I agree
9-Now click on Next
10-Click on Install and program will start the installation

11-After Installation click on OK and Finish then a dialogue box will appear on new
Window click ok again
12-Now program is Installed Click on New Project and Select console application on right corner
and press Go
13-Now Click on C language and press Next
14-Fill the blank spaces by adding a project name and proper path and click next
15- on next window just click finish
16- On next page on left corner click on source and then this window will appear
17-Now look at the tool bar above you will see a gear and play sign together under wxSmith
option click on it or simply press F9.
If this window appears it means your application is successfully installed.
Explanation:
 The parentheses after main indicate that main is a program building block called a
function. C programs contain one or more functions, one of which must be main. As we
discussed above that every program in C begins executing at the function main.

 return 0 is included at the end of every main function. The keyword return is one of
several means. We will use it to exit a function. When the return statement is used at the
end of main as shown here, the value 0 indicates that the program has terminated
successfully. We will discuss the reasons for including this statement later. For now,
simply include this statement in each program, or the compiler might produce a warning
on some systems.

 The "curly braces" { and } signal the beginning and end of functions and other code
blocks. These are also called delimiters.

 ; is known as statement terminator. It tells the compiler that a particular statement


(containing one or more than one lines) has finished.
Lab Tasks
Task 1:

Write five C++ statements to print the asterisk pattern as shown below using printf?

Sample Output:

*****

Task 2:
Write a c program to print her/his name, id, address, phone number to display the text on the
screen like that?
Sample Output:

Ali 12003065299 Mintgumri Road Lahore

Task 3:
Modify the task 2 and print your Program, Batch and Course name.
Sample Output:

Ali 12003065299 Mintgumri Road Lahore BSCS 26 Programming Fundamental

You might also like