cse 13 (1)
cse 13 (1)
Student Details
Name ID
[For Teachers use only: Don’t Write Anything inside this box]
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.
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 4: Read 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 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 4: Read C
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 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.