Get two numbers from user and print the sum
PRINT "Enter first number:"
INPUT num1
PRINT "Enter second number:"
INPUT num2
LET sum = num1 + num2
PRINT "The sum of"; num1; "and"; num2; "is"; sum
END
Write a program to display area of a rectangle
CLS
PRINT "Rectangle Area Calculator"
INPUT "Enter the length of the rectangle: ", length
INPUT "Enter the width of the rectangle: ", width
LET area = length * width
PRINT "The area of the rectangle is: "; area
END
(Breakdown of the Code:
CLS clears the screen for a clean display.
PRINT displays a title and guides the user.
INPUT collects values for length and width.
LET computes the area by multiplying the two.
PRINT shows the final result with a helpful label.
Program to input Name of student and print it with hello
CLS
INPUT "Enter your name: ", name
PRINT "Hello "; name
END
Write a program to get age in years and multiply Age by 12 to Convert to Months
CLS
INPUT "Enter your age in years: ", age
LET months = age * 12
PRINT "Your age in months is: "; months
END
Write a program to get number of bananas you have. Also get number of bananas eaten by the monkey. Calculate and display the remaining bananas.
CLS
INPUT "Enter the total number of bananas: ", totalBananas
INPUT "Enter the number of bananas eaten by the monkey: ", eatenBananas
LET remainingBananas = totalBananas - eatenBananas
PRINT "Remaining bananas after the monkey feast: "; remainingBananas
END