0% found this document useful (0 votes)
2 views

cse 13 (1)

The lab report from Green University of Bangladesh's CSE department details an experiment on expressions in C programming. It outlines objectives including calculating the area of a square, converting temperatures between Celsius and Fahrenheit, and calculating average marks from five subjects. The report includes algorithms for each task, implementation details, and a discussion of the challenges and learning outcomes from the assignment.

Uploaded by

oliketamim
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views

cse 13 (1)

The lab report from Green University of Bangladesh's CSE department details an experiment on expressions in C programming. It outlines objectives including calculating the area of a square, converting temperatures between Celsius and Fahrenheit, and calculating average marks from five subjects. The report includes algorithms for each task, implementation details, and a discussion of the challenges and learning outcomes from the assignment.

Uploaded by

oliketamim
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 8

Green University of Bangladesh

Department of Computer Science and Engineering (CSE)

Faculty of Sciences and Engineering

Semester: (Spring, Year:2023), B.Sc. in CSE (Day)

LAB REPORT NO: 01


Course Title: Structured Programming Lab

Course Code: CSE 104 Section: 221 D3

Lab Experiment Name: Introduction to Expression in C.

Student Details
Name ID

1. MD. Delowar Zahan 223002081

Lab Date : 7.3.2023

Submission Date : 14.3.2023

Course Teacher’s Name : Md. Nasif Osman Khansur

[For Teachers use only: Don’t Write Anything inside this box]

Lab Report Status

Marks: ………………………………… Signature:.....................

Comments:.............................................. Date:..............................
1.TITLE OF THE LAB REPORT EXPERIMENT:

Introduction to Expression in C.

2.OBJECTIVES:

1. Write a C program to calculate area of a square, take length of one side as user input.

2. Write a C program to enter temperature in Celsius and convert it into Fahrenheit.

3. Write a C program to enter temperature in Fahrenheit and convert it into Celsius.

4. Write a C program to enter marks of five subjects and calculate total and average marks.

3.ALGORITHM:

Algorithm 1:

Step 1: Start

Step 2: Declare float variable d and area

Step 3: Display a message on the monitor “Enter length: ”

Step 4: Read d

Step 5: Calculate area = (d*d)

Step 6: Display result of area of the square with message “Area of the square: ”

Step 7: End

Algorithm 2:

Step 1: Start

Step 2: Declare float variable C and F

Step 3: Display a message on the monitor “Enter Celsius temperature:”

Step 4: Read C

Step 5: Calculate F = ( (9 * C) / 5 ) + 32

Step 6: Display temperature in Fahrenheit on the monitor with message “Fahrenheit temperature: ”

Step 7: End
Algorithm 3:

Step 1: Start

Step 2: Declare float variable C and F

Step 3: Display a message on the monitor “Enter Fahrenheit temperature:”

Step 4: Read C

Step 5: Calculate C = ( 5 * (F-32) ) / 9

Step 6: Display temperature in Celsius on the monitor with message “Celsius temperature: ”

Step 7: End

Algorithm 4:

Step 1: Start

Step 2: Declare float variable s1, s2, s3, s4, s5, Total, Avg

Step 3: Display a message on the monitor “Enter marks of the five students : ”.

Step 4: Read s1, s2, s3, s4, s5

Step 5: Calculate Total = (s1+s2+s3+s4+s5)

Step 6: Calculate Avg = Total / 5

Step 7: Display result of Total mark on the monitor with a message “Total mark : ”

Step 8: Display result of Average on the monitor with a message “Average mark : ”

Step 9: End
IMPLIMENTATION:
Program 1:

OUTPUT
Program 1:
IMPLIMENTATION:
Program 2:

OUTPUT
Program 2:
IMPLIMENTATION:
Program 3:

OUTPUT
Program 3:
IMPLIMENTATION:
Program 4:

OUTPUT
Program 4:
DISCUSSION:
1. The output of the programs are as per the formula I applied.
Output could be float value thus I used float variable.
2. The formula I applied worked well and gave correct output.
3. The trouble spots in completing this assignment are taking output
from user, implementing the formulas and writing the code without
any error.
4. The implementation of the formula in the code was the most
difficult part of my program.
5. The good thing about the assignment is I solved the problems and
I implemented the programs practically by myself.
6. I learned about use of expression in C program.
7. I successfully implemented all the programs that was my
objective.

You might also like