UNIT-1/2
INPUT/OUTPUT
1 WAP to add two numbers.
2 WAP to add two numbers in which one is integer and other one is floating
WAP that accepts the temperature in Centigrade and converts into Fahrenheit using the
3 formula C/5 = (F-32)/9.
WAP that accepts the marks of 5 subjects and finds the sum and percentage marks
4 obtained by the student.
5 WAP to calculate the area and circumference of a rectangle & circle.
6 WAP that swaps values of two variables with and without using a third variable.
WAP that calculates the Simple Interest and Compound Interest. The Principal Amount,
7 Rate of Interest and Time are entered through the keyboard.
8 Write a program to calculate the area of triangle using formula at=√s(s-a)(s-b)(s-c)
9 WAP to convert a character upper case to lower case.
10 WAP to convert a character lower case to upper case.
11 WAP to print ASCII value of a character.
OPERATORS
12 WAP that checks whether the two numbers entered by the user are equal or not.
13 WAP to find the greater of two numbers using ternary operator.
14 WAP that finds whether a given number is even or odd using ternary operator.
15 WAP that tells whether a given year is a leap year or not using conditional operator.
16 WAP to find the greatest of three numbers using conditional operator.
Write a C program to input age of three students of a class and determine youngest of the
17
three using ternary operator.
DECISION MAKING STATEMENTS
18 P t WAP to find the greatest of three numbers using nested if else.
19 Write a program in C to input the sides of a triangle and display whether it is equilateral,
isosceles, scalene or right angled.
WAP that accepts marks of five subjects and finds percentage and prints grades according
to the following criteria:
Between 90-100%-----Print ‘A’
20 80-90%-----------------Print ‘B’
60-80%-----------------Print ‘C’
Below 60%-------------Print ‘D
21 Write a program to determine the nature of roots of quadratic equation.
A certain grade of steel is graded according to the following conditions:
i Hardness must be greater than 50
ii Carbon content must be less than 0.7
iii Tensile strength must be less than 5600
22 The grades are as follows:
Grade is 10 if all the three conditions are met.
Grade is 9 if condition (i) and (ii) are met
Grade is 8 if condition (ii) and (iii) are met
Grade is 7 if condition (i) and (iii) are met
Grade is 6 if only one condition is met.
Grade is 5 if none of the conditions are met.
Write a program, which will require the user to give values of hardness, carbon content
and tensile strength of the steel under consideration and output the grade of the steel.
23 WAP to check whether a character is vowel, consonant, digit or special symbol.
A company gives insurance to its drivers in the following cases:
(i) If the driver is married.
(ii) If the driver is unmarried, male & above 30 years of age.
24 (iii) If the driver is unmarried, female & above 25 years of age.
In all other cases, the driver is not insured. If the marital status, gender and age of a driver
are inputs, write a program to determine whether the driver is to be insured or not.
Write a C program to accept a coordinate point in an XY coordinate system and
25 determine in which quadrant the coordinate point lies.
SWITCH CASE STATEMENTS
26 Write a program in C to implement a calculator using case in character format.
Write a program to find the value of y for a particular value of n. The a, x, b, n is input by
27 user if n=1 y=ax%b, if n=2 y=ax2+b2, if n=3 y=a-bx, if n=4 y=a+x/b.
28 WAP in C to check whether a character is vowel or consonant using switch statement
29 WAP in c to check whether a number is even or odd using switch statement.
Write a menu driven C program to calculate area of any four geometrical figures using
30 switch.