A data file "CLASS.DAT" has a record with students' names, classes, roll no, and sections. Print the record.
A sequential data file called "MARKS.DAT" contains roll no, name, English, Nepali, and maths fields. Write a program to display all the contents of the data files.
Write a program using SUB.....END SUB to get the radius of the circle and then print its area.
Write a program using FUNCTION... END FUNCTION to get a word from the user then prints the word in reverse.
Study the following program and answer the given question:
DECLARE FUNCTION diff (A,B)
CLS
INPUT"ENTER FIRST NUMBER;";A
INPUT"ENTER SECOND NUMBER;";B
PRINT"THE DIFFERENCE OF THE TWO NUMBERS=";diff (A,B)
END
FUNCTION diff (A,B)
END
FUNCTION diff(A,B)
D = A - B
DIFF = D
END FUNCTION
Rewrite the given program after correcting the bugs.
DECLARE FUNCTION SERIES()
CLS
EXECUTE SERIES
END
SUB SERIES ()
A=2
B=2
FOR CTR=1 TO 5
DISPLAY A;B;
A=A+B
B=B+A
NEXT CTR
END SUB
Write the output of the given program.
DECLARE FUNCTION INTEREST (P, T, R)
CLS
LET P = 30
LET T = 40
LET R = 6
LET D = INTEREST (P, T, R)
PRINT "THE SIMPLE INTEREST WILL BE";D
END
FUNCTION INTEREST (P, T, R)
ANSWER = (P*T*R)/100
INTEREST = ANSWER
END FUNCTION
Write a program to input a number and find the factorial of the number.
Write a program to input a number and print all the perfect square numbers from 1 to 1000.
Write a program to input a string and find the sum of the ASCII values of the characters in the string.
PathshalaNepal.com is a Registered Company of E. Pathshala Pvt Ltd Nepal. Registration number : 289280
© 2020. All right Reversed.E. Pathshala Pvt Ltd