0% found this document useful (0 votes)
4 views2 pages

CP Questions - For - Lab - Sheet

Uploaded by

Shiva Shrestha
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)
4 views2 pages

CP Questions - For - Lab - Sheet

Uploaded by

Shiva Shrestha
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/ 2

LAB SHEET 1

Lab exercises:
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 simple interest for a given P = 4000, T = 2, R =
5.

LAB SHEET 2
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 + ++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 SHEET #3
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
1. Write a program to input marks of 5 subjects for a students. Display the rank
of each subjects and also the result of total marks and percentage obtained
with his / her rank in the class. The rank is categorized as fail (marks < 40%).
First (marks between 65 to 80%), distinction (marks between 80 to 95%),
extra ordinary (marks above 95 to 100%).
2. Write a program to find the largest and smallest among three entered
numbers and also display whether the identified largest / smallest number is
even or odd.
3. Write a program to check whether input alphabet is vowel or not using if-else
and switch statement.
4. Write a program to get input of two or higher integer number and display in
reverse order.
5. Write a program that asks a number and test he number whether it is
multiple of 5 or not, divisible by 7 but not by 11.
6. Write a program to check whether the entered year is leap year or not (a
year is leap year if it is divisible by 4 and divisible by 100 or 400).
7. Write a program to read the values of coefficients a, b and c of a quadratic
equation ax2 + bx +_ c = and find the root of the equation.

You might also like