Lab sheet
Lab sheet
1. Cover page
2. Title
3. Objectives(s)
4. Problem Analysis
5. Algorithm
6. Flowchart
7. Coding
8. Output (compilation, debugging & testing )
9. Discussion & Conclusion
Title:
Write a program to calculate the volume of a CUBOID having its height (h = 10cm), width (w =
12cm) and depth (d = 8cm).
Objective (s):
Problem Analysis:
Algorithm:
Step 1: Start
Step 6: Stop
Flowchart:
START
INT h, w, d, Vol
Vol = h * w * d
Display Vol
STOP
Program Code:
#include<stdio.h>
#include<stdlib.h>
Int main()
int h = 10;
int w = 12;
int d = 8;
int Vol = h * w * d;
return 0;
Output:
Lab exercises:
Lab Exercises:
1. Write a program to take input of name, roll no and marks obtained by a student in 5 subjects
each have its 100 full marks and display the name, roll no with percentage score secured.
2. Write a program to declare two integers and one float variables then initialize them to 10, 15
and 12.6. Also print he variable values in the screen.
3. Write a program to check odd or even number.
a. Using modulus operator
b. Using bitwise operator
c. Without using bitwise and modulus operator
d. Using conditional operator
4. Print the value of y for given x = 2 & z = 4 and analyze the output.
a. y = x++ + ++x;
b. y = ++x + ++x;
c. y = ++ + ++x + ++X
d. y = x > Z
e. y = x > z ? x : z ;
f. y = x & z;
g. y = x>>2 + z<<1;
5. write a program to print the size of char, float, double and long double data types in C.
Lab Exercise:
1. Get input of your name, address, age in years, weight and height from keyboard and display the
information .
2. Demonstrate the differences among getch(), getche(), getchar(). Demonstrate the difference
between scanf() & gets(), print() & puts().
LAB SHEET #4 Control Statement
1. Write a program to create an structure of book having fields ‘title’, ‘author’, ‘Publication’, ‘Price’.
2. Write a C program that takes roll_no, fname, lname of 5 students and print the same record on the
screen.
3. Addition, subtraction, multiplication and division using structure.