Beruflich Dokumente
Kultur Dokumente
(index.php)
Download
ARRAY PROGRAMS
WAP to accept any 10 numbers from user and display sum of odd digits using an array.
CLS
OPTION BASE 1
DIM N(10)
FOR j= 1 TO 10
INPUT “Enter any 10 numbers ”;N(j)
NEXT j
FOR k=1 TO 10
IF N(j) MOD 2<>0 THEN Sum=Sum+N(j)
NEXT k
PRINT “Sum of odd numbers is ”; Sum
END
WAP to accept any 10 numbers from user and display the greatest number among them using an array.
http://www.hamrodiary.com/solution9.php?id=20 1/5
2/16/2018 Computer science program solution for class 9
CLS
OPTION BASE 1
DIM N(10)
FOR j= 1 TO 10
INPUT “Enter any 10 numbers ”;N(j)
NEXT j
FOR k=1 TO 10
IF N(j)>g THEN g=N(j)
NEXT k
PRINT “The greatest number is ”;g
END
WAP to accept any 10 numbers from user and display them in descending order using an array.
CLS
OPTION BASE 1
DIM N(10)
FOR j= 1 TO 10
INPUT “Enter any 10 numbers ”;N(j)
NEXT j
FOR j=1 TO 9
FOR k=1 TO 10-j
IF N(k)<N(k+1) THEN SWAP N(k), N(k+1)
NEXT k
NEXT j
PRINT “The numbers in descending order are listed below”
FOR j=1 TO 10
PRINT N(j)
NEXT j
END
WAP to accept any 10 students name from user and display them in ascending order using an array.
http://www.hamrodiary.com/solution9.php?id=20 2/5
2/16/2018 Computer science program solution for class 9
CLS
OPTION BASE 1
DIM N(10) AS STRING
FOR j= 1 TO 10
INPUT “Enter any 10 students name ”;N(j)
NEXT j
FOR j=1 TO 9
FOR k=1 TO 10-j
IF N(k)>N(k+1) THEN SWAP N(k), N(k+1)
NEXT k
NEXT j
PRINT “The students name in ascending order are listed below”
FOR j=1 TO 10
PRINT N(j)
NEXT j
END
WAP to accept any 10 numbers from user and display the greatest and smallest number among them using an array.
CLS
OPTION BASE 1
DIM N(10)
FOR j= 1 TO 10
INPUT “Enter any 10 numbers ”;N(j)
NEXT j
FOR j=1 TO 9
FOR k=1 TO 10-j
IF N(k)>N(k+1) THEN SWAP N(k), N(k+1)
NEXT k
NEXT j
PRINT “The smallest number is ”; N(1)
PRINT “The greatest number is ”; N(10)
END
http://www.hamrodiary.com/solution9.php?id=20 3/5
2/16/2018 Computer science program solution for class 9
Add a comment...
Learn more
Related Topics/Solution
Q-BASIC General / IF Statements Programs (solution9.php?id=15)
FOR ..... NEXT LOOP PROGRAMS (solution9.php?id=16)
SERIES PROGRAMS (solution9.php?id=17)
WHILE...WEND LOOP AND DO...LOOP PROGRAMS (solution9.php?id=18)
LIBRARY FUNCTION PROGRAMS (solution9.php?id=19)
ARRAY PROGRAMS IN QBASIC (solution9.php?id=20)
WAP to generate the given numeric patterns. (solution9.php?id=21)
http://www.hamrodiary.com/solution9.php?id=20 4/5
2/16/2018 Computer science program solution for class 9
Related Posts
http://www.hamrodiary.com/solution9.php?id=20 5/5