Connect Me

twitterfacebookgoogle plus email

  Instagram View Biwas Bhattarai's profile on LinkedIn
Showing posts with label QBasic Program for Grade 10. Show all posts
Showing posts with label QBasic Program for Grade 10. Show all posts

WAP to enter multi-digits numbers and print only even numbers from them. (If input is 5481, output is 4,8)

DECLARE SUB SUM(N)
CLS
INPUT "ENTER MULTI-DIGITS NUMBER";N
CALL SUM(N)
END 

SUB SUM(N)
WHILE N<>0
R=N MOD 10
IF R MOD 2=0 THEN PRINT "EVEN DIGIT IS "; R
N=N\10
WEND
END

WAP to generate the series: 1,2, 4, 7, 11, 16, 22, 29, 37 till 20th terms

DECLARE SUB SERIES()
CLS
CALL SERIES
END

SUB SERIES()
A=1
FOR I=1 TO 20
PRINT A;
A=A+I
NEXT I
END SUB
Same program in little change (without using loop value to generate series)
DECLARE SUB SERIES()
CLS
CALL SERIES
END

SUB SERIES()
A=1
B=1
FOR I=1 TO 20
PRINT A;
A=A+B
B=B+1
NEXT I
END SUB
Ą
https://www.flickr.com/photos/spklg/15211044551/