Programming Is Kinda Fun
1. WAP to enter any 2 numbers and display its sum.
=> CLS
INPUT "Enter first number"; A
INPUT "Enter second number"; B
S = A + B
PRINT "Sum ="; S
END
2. WAP to enter any 3 numbers and display its product.
=> CLS
INPUT "Enter first number"; A
INPUT "Enter second number"; B
INPUT "Enter third number"; C
P = A * B * C
PRINT "Product = "; P
END
3. WAP to enter any 5 numbers and display its average.
=> CLS
INPUT "Enter first number"; A
INPUT "Enter second number"; B
INPUT "Enter third number"; C
INPUT "Enter fourth number"; D
INPUT "Enter fifth number"; E
AVG = (A+B+C+D+E)/5
PRINT "Average = "; AVG
END
4. WAP to enter two numbers and display its sum, product, difference and average.
=> CLS
INPUT "Enter first number"; A
INPUT "Enter second number"; B
S = A + B
P = A * B
D = A - B
AVG = S/2
PRINT "Sum = "; S
PRINT "Product = "; P
PRINT "Difference = "; D
PRINT "Average = "; AVG
END
5. WAP to enter three numbers and display its sum, product and average.
=> CLS
INPUT "Enter first number"; A
INPUT "Enter second number"; B
INPUT "Enter third number"; C
S = A + B + C
P = A * B * C
AVG = S/3
PRINT "Sum = "; S
PRINT "Product = "; P
PRINT "Average = "; AVG
END
6. WAP to display square of an input number.
=> CLS
INPUT "Enter any number"; A
S = A ^ 2
PRINT "Square of the given number = "; S
END
7. WAP to display cube of an input number.
=> CLS
INPUT "Enter any number"; A
C = A ^ 3
PRINT "Cube of the given number = "; C
END
8. WAP to display square root of an input number.
=> CLS
INPUT "Enter any number" ; A
SR = A ^ (1/2)
PRINT "Square root of given number = "; SR
END
9. WAP to display cube root of an input number.
=> CLS
INPUT "Enter any number" ; A
CR = A ^ (1/3)
PRINT "Cube root of given number = "; CR
END
10. WAP to input two different numbers and find the remainder dividing the first number by second one.
=> CLS
INPUT "Enter first number"; A
INPUT "Enter second number" ; B
R = A MOD B
PRINT "Remainder = "; R
END
=> CLS
INPUT "Enter first number"; A
INPUT "Enter second number"; B
S = A + B
PRINT "Sum ="; S
END
2. WAP to enter any 3 numbers and display its product.
=> CLS
INPUT "Enter first number"; A
INPUT "Enter second number"; B
INPUT "Enter third number"; C
P = A * B * C
PRINT "Product = "; P
END
3. WAP to enter any 5 numbers and display its average.
=> CLS
INPUT "Enter first number"; A
INPUT "Enter second number"; B
INPUT "Enter third number"; C
INPUT "Enter fourth number"; D
INPUT "Enter fifth number"; E
AVG = (A+B+C+D+E)/5
PRINT "Average = "; AVG
END
4. WAP to enter two numbers and display its sum, product, difference and average.
=> CLS
INPUT "Enter first number"; A
INPUT "Enter second number"; B
S = A + B
P = A * B
D = A - B
AVG = S/2
PRINT "Sum = "; S
PRINT "Product = "; P
PRINT "Difference = "; D
PRINT "Average = "; AVG
END
5. WAP to enter three numbers and display its sum, product and average.
=> CLS
INPUT "Enter first number"; A
INPUT "Enter second number"; B
INPUT "Enter third number"; C
S = A + B + C
P = A * B * C
AVG = S/3
PRINT "Sum = "; S
PRINT "Product = "; P
PRINT "Average = "; AVG
END
6. WAP to display square of an input number.
=> CLS
INPUT "Enter any number"; A
S = A ^ 2
PRINT "Square of the given number = "; S
END
7. WAP to display cube of an input number.
=> CLS
INPUT "Enter any number"; A
C = A ^ 3
PRINT "Cube of the given number = "; C
END
8. WAP to display square root of an input number.
=> CLS
INPUT "Enter any number" ; A
SR = A ^ (1/2)
PRINT "Square root of given number = "; SR
END
9. WAP to display cube root of an input number.
=> CLS
INPUT "Enter any number" ; A
CR = A ^ (1/3)
PRINT "Cube root of given number = "; CR
END
10. WAP to input two different numbers and find the remainder dividing the first number by second one.
=> CLS
INPUT "Enter first number"; A
INPUT "Enter second number" ; B
R = A MOD B
PRINT "Remainder = "; R
END
RESULTS
2.
3.
4.
5.
6.
7.
8.
9.
10.
Comments
Post a Comment