Professional Documents
Culture Documents
Control Statements
Control Statements
Control Statements
CONTROL -STATEMENTS
IFELSE
1.WAP to find maximum number in two numbers by IF..ELSE. 2. WAP to find maximum number in three numbers by IF..ELSE. 3. WAP to check a number is even or odd by IF..ELSE. 4. WAP to check a number is prime or not by IF..ELSE. 5. WAP to check a year is leap or not by IF..ELSE and also by AND and OR operator.
Nex-G Exuberant Solutions Pvt. Ltd.
NESTED IFELSE
1.WAP to find maximum number in four numbers by IF..ELSE. 2.WAP to calculate the LCM and HCF of number. 3.WAP to enter a numbers and check number is negative or positive.
1.WAP to enter five subject marks and find percentage and print the following message on the condition. Per<30---you are failed per>=30 and per<45-you got third division per>=45 and per<60-you got second division per>=60 and per<75-you got first division per>=75 and per<90-you got honoured division per>=90---you are hero.
Nex-G Exuberant Solutions Pvt. Ltd.
PROGRAMS
2.WAP to enter age print the following message on the condition. age<18---not eligible for vote age>=18 and age<30-vote for BSP age>=30 and age<60-vote for BJP age>=60 and age<90-vote for UPA age>=90 take at home
SWITCH CASE
1.WAP to perform the arithemetic operation through switch case--Press 1 for addition of two numbers. Press 2 for subtraction of two numbers. Press 3 for multiplication of two numbers. Press 4 for division of two numbers. Default: enter the valid number.
SWITCH CASE
2.WAP to perform the arithemetic operation through switch case--Press + for addition of two numbers. Press - for subtraction of two numbers. Press * for multiplication of two numbers. Press / for division of two numbers. Default: enter the valid number.
ADVANCE
1.WAP to perform the operation ATM machine by using switch case--Press 1 for add amount in original amount. Press 2 for withdraw Press 3 for balance enquire. Press 4 for exit. Default: enter the valid number.
GOTO
1.WAP to check numbers is even or not by goto statements. 2. WAP to print 1 to 100 count using goto statements 3. WAP to find maximum number in two numbers by goto.