If-Else Practice Sheet
If-Else Practice Sheet
Lab Assignments
Set 2 Set2
Input values for a, b The Roots are real &
and c=>1 8 3 unequal.
Roots are -0.39 and -
7.61
Set 3 Set 3
Input values for a, b The Roots are
and c=>3 5 7 imaginary
Root1=-0.17+i1.28
Root2=-0.17-i1.28
6 WAP to display the Set-1 Set-1
grade system of KIIT Enter total mark
University based on secured by a Secured grade is C
total marks secured by student: 55
a student in a Secured grade is C Set-2
semester. Assume Secured grade is O
marks are integer Set-2
values. Use multiple if- Enter total mark
else statement. secured by a
The grade is calculated student: 95
is as follows: Secured grade is O
Marks Grade
90 to 100 O
80 to 89 E
70 to 79 A
60 to 69 B
50 to 59 C
40 to 49 D
< 40 F
9 WAP to find the roots of Input values for a, b Input values for a, b
a quadratic equation and c=> and c=>1
ax2+bx+c=0 using 1 2
switch-case statement. 2 1
1
Set2
Set2 The Roots are real &
Input values for a, b unequal.
and c=>1 8 3 Roots are -0.39 and -
7.61
Set 2
Input values for a, b Set 3
and c=>3 5 7 The Roots are
imaginary
Root1=-0.17 + i1.28
Root2=-0.17 - i1.28