You are on page 1of 1

Tutorial 1 (Variable, Data type, Input/Output)

1. WAP to print “HELLO WORLD” in C.


2. Write a C program to declare two integer and one float variables then initialize them to 10, 15,
and 12.6. It then prints these values on the screen.
3. WAP to ilustrate the declaration of global and local variable.
4. WAP to Illustrate all data types (int, float, char, double) in C.
5. WAP to print the size of different data types in C, using 'sizeof()' function.
6. Write a C program to prompt the user to input her/his age and print it on the screen, as shown
below.
You are 20 years old.
7. WAP to read two numbers from user and calculate sum, average and subtraction of numbers.
8. WAP to read radius of the circle and find the area and perimeter of the circle.
9. Write a C program to calculate X^N (X to the power of N) using pow function.
10. Write a C program to convert temperature from Fahrenheit to Celsius.
11. Write a program to use escape sequences to print special characters like new line, tab space,
inverted commas and backspace in printf statements.
12. Write a program to read Basic Salary (BS) of an employee, hra is 10% of BS and da is 5% of
BS. Then calculate the Gross Salary of the employee.
13. Write a program to read principle, rate and time and then calculate Simple Interest.
14. Write five statements by using printf function to print the asterisk pattern:

*****
*****
*****
*****
*****
15. Write a C program to prompt the user to input 3 integer values and print these values in forward
and reversed order, as shown below.
Please enter your 3 numbers: 12 45 78
Your numbers forward:
12
45
78
Your numbers reversed:
78
45
12

You might also like