LAB 3 (BRANCHING)
After this lab students will learn about various branching statements. write algorithms and draw flowchart for all programs .
- WAP to read a number from the user and test whether the number is negative. [ Show message “ THE NUMBER IS NEGATIVE” if it is a negative number , otherwise show nothing. [if-statement]
- WAP to read the percentage of marks obtained by a student in SLC and +2 level. Display message “CONGRATULATIONS!!! You have first division in both SLC and +2” if both levels have percentage greater than or equal to 60.[nested if]
- WAP to read a number from user and determine whether the number is even or odd.[if-else]
- WAP to read three numbers from user and determine the largest among them.[using conditional operator]
- WAP that reads total marks of a student in seven subjects. Then calculate the percentage and determine the division. Use following condition:[if-else if]
i)Percentage greater than or equal to 80 = distinction
ii)Percentage between 60-79 = first division
ii)Percentage between 45-59 = second division
ii)Percentage between 32-44 = third division
ii)Percentage less than or equal to 31 = fail