Experiment 3
Experiment 3
Title: Exploring Input/Output Operations and Data Types in C Programming Using printf and
scanf.
1. Write a C program that takes two integers from the user and prints their sum,
difference, product, and quotient. Ensure to handle division by zero.
2. Create a C program that prompts the user to enter their height in centimetres and
weight in kilograms. Then, calculate and display their Body Mass Index (BMI) using
the formula: BMI = weight / (height/100)².
3. Write a C program that prompts the user to enter their full name (first name and last
name), age, and favourite decimal number. The program should then display this
information in a formatted output.
4. Design a C program that accepts a floating-point number from the user and prints it
with two decimal places, four decimal places, and scientific notation.
5. Create a C program that reads a date in the format DD MM YYYY from the user and
then prints it in the format YYYY-MM-DD. Use appropriate data types to store and
manipulate the date.
Note: Mention your name and sap ID in every output.