1. Enter any two number and
display its sum.
CLS
INPUT"Enter
first number";A
INPUT"Enter
second number";B
S = A + B
PRINT"Sum
of two numbers=";S
END
2. Enter any three
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 of
three number=";P
END
3.Enter any five 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 of five
numbers=";AVG
END
4. Enter any two numbers and
display its sum,difference,product and average.
CLS
INPUT"Enter first
number";A
INPUT"Enter second
number";B
S=A+B
D=A-B
P=A*B
AVG=(A+B)/2
PRINT"Sum of two
numbers=";S
PRINT"Difference of two
numbers=";D
PRINT"Product of two
numbers=";P
PRINT"Average of two
numbers=";AVG
END
5.Enter any 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=(A+B+C)/3
PRINT"Sum of three
numbers=";S
PRINT"Product of three
numbers=";P
PRINT"Average of three
numbers=";AVG
END
6. Display square of an input
number.
CLS
INPUT"Enter any
number";A
S=A^2
PRINT"Square of the
given number is=";S
END
7. Display cube of an
input number.
CLS
INPUT"Enter any
number";A
C=A^3
PRINT"Cube of the given
number=";C
END
8.Display square root of an
input number.
CLS
INPUT"Enter any
number";
S=A^(1/2)
PRINT"Square root of the
given number is=";S
END
9.Display cube root of an
input number.
CLS
INPUT"Enter any
number";A
C=A^(1/3)
PRINT"Cube root of the
given number is=";C
END
10.Input two different
numbers and find the remainder dividing the first number by the second number.
CLS
INPUT"Enter first
number";A
INPUT"Enter second
number";B
R=A MOD B
PRINT"The remainder
is=";R
END
11. Display area of rectangle.
CLS
INPUT "Enter length";L
INPUT "Enter breadth";B
A=L*B
PRINT "Area of rectangle=";A
END
12.Display area of square.
CLS
INPUT "Enter length";L
A=L^2
Print "Area of square=";A
END
13. Display area of circle.
CLS
INPUT "Enter radius";R
A=22/7*R^2
PRINT "Area of circle=";A
END
14. Display perimeter of rectangle.
CLS
INPUT"ENTER LENGTH"; L
INPUT"ENTER BREADTH"; B
P=2*(L+B)
PRINT"PERIMETER OF RECTANGLE ";P
END
15. Display perimeter of square.
CLS
INPUT "ENTER LENGTH"; L
P=4*L
PRINT"Perimeter of square=";P
END
16. Display circumference of circle.
CLS
INPUT"ENTER RADIUS";
C=2*22/7*R
PRINT"Circumference of circle=";C
END
17 Display area and perimeter of rectangle.
CLS
INPUT "Enter length";L
INPUT "Enter breadth";B
A=L*B
P=2*(L+B)
PRINT "Area of rectangle=";A
PRINT"Perimeter of rectangle="P
END
18. Display area and perimeter of square.
CLS
INPUT "Enter length";L
A=L^2
P=4*L
PRINT "Area of square="A
PRINT"Perimeter of square=";P
END
19.Display area and circumference of circle.
CLS
INPUT "Enter radius";R
A=22/7*R^2
C=2*22/7*R
PRINT "Area of circle=";A
PRINT"Circumference of circle=";C
END
Comments
Post a Comment