0% found this document useful (0 votes)
1 views8 pages

Lab report 1

The lab report details eight C programming exercises focused on arithmetic operations, area calculations, unit conversions, and average mark computations. Each exercise includes objectives, implementation details, test results, and an analysis of the challenges faced during execution. The assignment aimed to enhance programming skills and emphasize the importance of robust input handling and problem-solving techniques.
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)
1 views8 pages

Lab report 1

The lab report details eight C programming exercises focused on arithmetic operations, area calculations, unit conversions, and average mark computations. Each exercise includes objectives, implementation details, test results, and an analysis of the challenges faced during execution. The assignment aimed to enhance programming skills and emphasize the importance of robust input handling and problem-solving techniques.
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/ 8

Green University of Bangladesh

Department of Computer Science and Engineering (CSE)


Faculty of Sciences and Engineering
Semester: (Spring, Year:2025), B.Sc. in CSE (Day)

Lab Report NO :01


Course Title: Structured Programming Language
Course Code: CSE 104 Section: 242_D1

Lab Experiment Name: Lab Report 01

Student Details

Name ID

1. Sree Antor Chandra Adhikari 242002174

Lab Date : 26-01-2025


Submission Date : 02-02-2025
Course Teacher’s Name : Ms. Shamima Akter

Lab Report Status


Marks: ………………………………… Signature:.....................
Comments:.............................................. Date:..............................
TITLE OF THE LAB REPORT EXPERIMENT
1. Write a C program to enter two numbers and perform all arithmetic operations.
2. Write a C program to calculate the area and circumference of a circle.
3. Write a C program to enter length in centimeters and convert it into meters and kilometers.
4. Write a C program to calculate the area of a rectangle (user input for height and width).
5. Write a C program to calculate the area of a square (user input for side length).
6. Write a C program to enter temperature in °Celsius and convert it into °Fahrenheit.
7. Write a C program to enter temperature in Fahrenheit and convert it into °Celsius.
8. Write a C program to enter marks of five subjects and calculate total and average marks

OBJECTIVES/AIM
1. To perform basic arithmetic operations on two user-provided numbers.
2. To calculate the area and circumference of a circle given its radius.
3. To convert a length value in centimeters to meters and kilometers.
4. To calculate the area of a rectangle using user input for dimensions.
5. To calculate the area of a square using the user-provided side length.
6. To convert a temperature value from Celsius to Fahrenheit.
7. To convert a temperature value from Fahrenheit to Celsius.
8. To calculate the total and average marks of five subjects using user input.
PROCEDURE / ANALYSIS / DESIGN
Algorithm for Problem 8:
1. Start.
2. Take input for the marks of five subjects.
3. Calculate the total by summing all five marks.
4. Calculate the average by dividing the total by 5.
5. Display the total and average marks.
6. End.
IMPLEMENTATION
1. Write a C program to enter two numbers and perform all arithmetic operations.

2. Write a C program to calculate the area and circumference of a circle.


3. Write a C program to enter length in centimeters and convert it into meters and
kilometers.

4. Write a C program to calculate the area of a rectangle (user input for height and
width).
5. Write a C program to calculate the area of a square (user input for side length).

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


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

8. Write a C program to enter marks of five subjects and calculate total and average
marks
TEST RESULT / OUTPUT

Problem:1
Input:29,6
Output:
Sum:35
Subtraction:23
Multiplication:174
Division: 4.000000
Modulus:5
Problem:2
Input:7
Output:
Area:153.94
Circumference: 43.98
Problem:3
Input:12345
Output:
Meters:123.45
Kilometers: 0.12
Problem:4
Input:10,5
Output:
Area: 50.00
Problem:5
Input:6
Output:
Area: 36.00
Problem:6
Input:25
Output:
Temperature in Fahrenheit: 77.00
Problem:7
Input:98.6
Output:
Temperature in Celsius: 37.00
Problem:8
Input:85,90,78,88,92
Output:
Total:433.00
Average :86.60
ANALYSIS AND DISCUSSION

• Analysis: All programs functioned correctly for the given test cases.
• What went well? Efficient use of C programming concepts like loops, arithmetic
operations, and conditionals.
• Trouble spots: Handling edge cases like division by zero and negative inputs required
additional considerations.
• Difficult parts: Logical errors during unit conversions and managing data input.
• Liked about the assignment: It provided diverse scenarios to apply programming skills.
• Learned from assignment: Mastery of arithmetic operations, input handling, and
structured problem-solving.
• Mapping of objectives: All objectives were successfully achieved.

SUMMARY:

This lab report covers a series of eight problems, showcasing the application of basic C
programming concepts such as input handling, arithmetic operations, loops, and conditional
statements. Each problem presented unique challenges, from unit conversions and temperature
calculations to area computations and mark processing. The implementation emphasized both
functionality and robustness, ensuring accurate results for a variety of inputs. This assignment
enhanced programming skills, provided a structured approach to problem-solving, and reinforced
the importance of handling edge cases effectively.

You might also like