LAB 02 PROGRAMS
1. Write a program to calculate and display the area and perimeter of a circle. Consider
π = 3.1416. Take the input from user
2. Write a program to accept the name, roll number, and marks obtained by a student in
5 subjects (each out of 100) and display the name, roll number, total marks, and
percentage.
3. Write a program to convert temperature from Celsius to Fahrenheit and display the
result.
4. Write a program to interchange the values of two integer variables without using an
additional variable.
5. Write a program to display the size (in bytes) of int, float, double, char, and long data
types.
6. Write a program to demonstrate the effect of increment and decrement operations on
an integer variable.
7. Write a program to input two numbers and display the smaller number.
8. Write a program to find the greatest of three numbers.
Bonus Questions
• Evaluate the following expression and display the final values of both variables:
int a = 5, b = 3;
a = a++ + ++b + --a + b--;
• Evaluate the following expression and display the final values of both variables:
int x = 6, y = 4;
y = x++ + ++x + y-- + --y;