Lab Task - 2: Control Statement Related Problems
Lab Task - 2: Control Statement Related Problems
1. Read four integer values named A, B, C and D. Sole the following equation and print the
result.
a) (A * B - C * D)
b) 2A – B + 3D
c) A 2 + B 2 – C2 + D 2
d) A3 + B –C2
Input
The input file contains 4 integer values.
Output
Print SOLUTION with all the capital letters, according to the following example, with a
blank space before and after the equal signal.
Sample Input Output Sample
5 Solution of Equation - 1 = -26
6 Solution of Equation - 2 = 28
7 Solution of Equation - 3 = 76
8 Solution of Equation - 4 = 67
2. Create a grading system that will display the grade of your obtained mark.
3. Check whether the input is an Alphabet or a digit or a Special Character. If
Alphabet then check whether it is Vowel or Consonant.
Sample Input Output Sample
Test Case = 3 6 is a Digit
6 A is an Alphabet : It is an Vowel
A @ is a special character
@
Case:1
Enter Data You want to search
220
Case:2
Enter Data You want to search
120
4. Take some integer numbers as input in an array. Then display all the
positive and negative numbers separately.
5. Find out the summation of the elements of an array.