0% found this document useful (0 votes)
102 views7 pages

CSE Lab 1

The document provides instructions for students taking a C programming lab course. It outlines that students must complete 8-10 lab activities and submit lab reports following specific guidelines. The reports should include a cover page, title, objectives, problem analysis, algorithm, coding, output, and discussion/conclusion. Students are encouraged to complete programming questions before lab hours.

Uploaded by

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

CSE Lab 1

The document provides instructions for students taking a C programming lab course. It outlines that students must complete 8-10 lab activities and submit lab reports following specific guidelines. The reports should include a cover page, title, objectives, problem analysis, algorithm, coding, output, and discussion/conclusion. Students are encouraged to complete programming questions before lab hours.

Uploaded by

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

1

INSTRUCTIONS FOR LABORATORY

Dear Students,
Welcome to C programming Lab. For the practical works of C programming, you
have to complete at least eight to ten lab activities throughout the course. These
lab sheets will guide you to prepare for programming and submission of lab
reports. Further, it helps you to understand practically about the knowledge of
programming. You can use this lab guide as the base reference during your lab.
You have to submit lab report of previous lab into corresponding next lab during
when your instructor shall take necessary VIVA for your each lab works. For
your reference, “how to write a complete lab report?” is prepared as sample
report for LAB sheet #1 and LAB sheet #2 in this manual. For the rest of your
labs, please follow the reporting style as provided. Your lab report to be
submitted should include at least the following topics.
1. Cover page
2. Title
3. Objective(s)
4. Problem Analysis
5. Algorithm
6. Coding
7. Output
8. Discussion & Conclusion.
On each lab, you have to submit the report as mentioned above however for
additional lab exercises; you have to show the coding and output to your
instructor.
Note: The lab exercises shall not be completed in a single specific lab. Students
are encouraged to complete the programming questions given in the exercise
prior to come to the lab hour and do the lab for the given title/objectives.

Page 1 of 7
2

COURSE SYLLABUS

Faculty Faculty of Engineering


Department Department of EEE
Program BSEEE [BSc in Electrical & Electronic Engineering]
Name of Course Computer Programming Lab
Course Code CSE 1112
Pre-requisites N/A
Status Core EEE Course
Credit Hours 1.5
Section
Class Hours
Class Location
Course website
Name (s) of
Academic
staff / Md. Mahfuzul Haque
Instructor(s)

Contact
Office
Counselling Hours

Text Book Teach Yourself C (3rd edition) by Herbert Schildt


Reference C, the complete reference (4th edition) by Herbert Schildt
Bring your notebook and Lab handout. Codeblocks compiler is
Equipment & Aids installed in the respective laboratory computers. Do collect the
software named Codeblocks for home practice.
Computer Programming Lab is one of the fundamental laboratory
Course Rationale courses for EEE students. It aims to give students the practical idea
writing programs in C. In this course they will learn to implement
the concepts and algorithms taught in CSE 1111.

Page 2 of 7
3

In this course, students will learn to implement the algorithms and


Course Description art of problem solving utilizing programming skills. They will get a
first-hand experience regarding problem solving techniques using
programming concepts. Laboratory experiments cover all the basic
features and scopes of C programming language.

Course Objectives The course is designed to provide the background of the following
topics: C programming syntax, data types, for/while loop, array, etc.

Learning After the end of this course, the students will be able to:
Outcomes 1. Explain the execution of programs written in C language.
2. Write the C code for a given algorithm.
3. Implement Programs with pointers and arrays, perform
pointer arithmetic, and use the pre-processor derivatives.
4. Write programs that perform operations using derived data
types.

Teaching Methods Lecture, Laboratory software experiments

Assessment
Methods

Letter Marks Grade Letter Marks Grade


Grade % Point Grade % Point
A+ (Plus) 80-100 4.00 C+ (Plus) 50-54 2.50
Grading Policy
A (Plain) 75-79 3.75 C (Plain) 45-49 2.25
A- (Minus) 70-74 3.50 D (Plain) 40-44 2.00
B+ (Plus) 65-69 3.25 F (Fail) <40 0.00
B (Plain) 60-64 3.00
B- (Minus) 55-59 2.75

Page 3 of 7
4

1. 1. Lab Reports:
Report on previous Experiment must be submitted before the
beginning of new experiment. A bonus may be obtained if a
student submits a neat, clean and complete lab report.
2. 2. Examination:
Additional Course
Policies 3. 3. Unfair means policy:
In case of copying/plagiarism in any of the assessments, the
students involved will receive zero marks. Zero Tolerance will
be shown in this regard. In case of severe offences, actions
will be taken as per university rule.
4. 4. Counseling:

5. 5. Policy for Absence in Class/Exam:


If a student is absent in the class for anything other than
medical reasons, he/she will not receive attendance. If a
student misses a class for genuine medical reasons, he/she
must submit an application with the supporting documents
(prescription/medical report). He/she will then have to
follow the instructions given by the instructor for make-up.
In case of absence in the mid/final exam for medical grounds,
the student must also get his/her application forwarded by the
head of the department before a make-up exam can be taken.
It is recommended that the students inform the instructor
beforehand through mail if they feel that they will miss a
class/evaluation due to medical reasons.

Additional Info

Page 4 of 7
5

Experiment No: 01
Name of the Experiment: Get familiar with syntax of C programming language

Objective(s):

To be familiar with syntax and structure of C-programming. To learn problem solving techniques by
using C.

Learning outcome(s):
Students will be able to write simple programs in C. They will understand basic structure of C programs.

Problem:

Write a Program to calculate and display the volume of a CUBE having its height (h=10cm), width
(w=12cm) and depth (8cm).

Problem Analysis:

The problem is to calculate the volume of a CUBE having its inputs parameters identified as: Height
(integer type), width (integer type) and depth (integer type). The output of the program is to display the
volume; hence the output parameter is identified as vol (integer type). During the processing or
calculation phase, we don’t need any extra parameters (variables) for this problem.

The volume of the cube is the multiplication of its height, width and depth, hence the mathematical
formula to calculate volume is:

vol = height* width* depth. (vol = h*w*d)

Input Processing Output Necessary header


variables variables/calculations variables files/functions/macros
h(int) vol = h*w*d vol stdio.h
w(int) (int)
d(int)

Algorithm:

1. Start
2. Define variables: h(int), w(int), d(int), vol(int)
3. Assign value to variables: h = 10, w=12, d=8
4. Calculate the volume as: vol = h*w*d
5. Display the volume (vol)
6. Stop

Flowchart:

Page 5 of 7
6

Code:
//Following code is written and compiled in CodeBlocks IDE

#include <stdio.h>
int main()
{
//start the program
int h,w,d,vol;
//variables declaration
h=10;w=12;d=8;

//assign value to variables


vol=h*w*d;

//calculation using mathematical formula


printf("The Volume of the cube is: %d",vol);

//display the volume

return 0;
//end the main program
}

Page 6 of 7
7

Output (Compilation, Debugging & Testing)

The Volume of the cube is: 960

Discussion and Conclusion

This is the first code written in C program. The program is focused on the calculation of volume of a cube
for the given height, width and depth. From this lab, I understood the basic structure of C programming
including the meaning of header files & steps of problem solving. Hence, volume of a cube is calculated
and displayed.

Lab exercises (please code yourself and show the output to instructor):

1. Write a program to display “hello world” in C.

2. Write a program to add two numbers (5&7) and display its sum.

3. Write a program to multiply two numbers (10&8) and display its product.

4. Write a program to calculate area of a circle having its radius (r=5).

5. Write a program to calculate area of an ellipse having its axes (minor=4cm, major=6cm).

6. Write a program to calculate simple interest for a given P=4000, T=2, R=5.5. (I = P*T*R/100)

Page 7 of 7

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy