QBASIC PROGRAMMING *WAP TO FIND SUM OF DIGIT . (SUB) DECLARE SUB SUM (N) CLS INPUT"ENTER ANY NUMBER ";N CALL SUM (N) END SUB SUM (N) S=0 WHILE N< >0 R= N MOD 10 S= S+R N= N\10 WEND PRINT "SUM OF DIGIT ";S END SUB
Posts
- Get link
- X
- Other Apps
Write a program that asks marks in any subject and display the message "Result pass" if the input number is greater than 40 CLS INPUT " enter marks in computer ";c IF c>= 40 THEN PRINT "Result pass"ELSE PRINT"Result fail" END Write a program that asks any two number and display the one CLS INPUT"enter first number":a INPUT"enter second number";b If a>b THEN PRINT "the greater number is ": a ELSE PRINT" the greater number is";b END if END Write a program that checks whether the supplied number is even or odd CLS INPUT"enter any number":n If n mod 2=0 THEN PRINT " even number" ELSE PRINT " odd number" END IF END Write a program that checks your age and tells whether you are eligible CLS INPUT"ENTER your age":a IF a>=18 THEN PRINT " you are eligible to vote" ELSE PRINT" your are not eligible to vote" E