Home  |  IT Zone  |  Tips / Tricks  |  Did You Know  |  Inspirational  |  Health  |  World Infos  |  Insurance  |  Universities  |  Forex  |  Mathematics  |  Illusions  |  Children Day Quotes  |  Fun / Jokes  |  Decent Quotes  |  Birthday Msgs  |  Good Morning Msgs  |  Good Night Msg  |  Husband Wife Jokes  |  Teacher Students Jokes  |  Insult Jokes  |  Love Quotes  |  Sad Quotes  |  Funny Pics  |  Be Aware  |  Articles  |  Simple Joys of Life 

Read the program and answer the given questions (Qbasic) - 1

DECLARE FUNCTION sum(n)
CLS
INPUT "Entery any number"; num
s = sum(num)
PRINT s
END

FUNCTION sum (n)
WHILE n <> 0
    r = n MOD 10
    sum = sum + r
    n = INT(n / 10)
WEND
END FUNCTION

Questions:

1. What will be the output of the program if user inputs the number 436?
    Ans: If user inputs the number 436, the output of the program will 13.
2. What will be the outpur of the program if user inputs the number 463?
    Ans: If user inputs the number 436, the output of the program will 13.
3. List the name of procedure modules declared in the above program.
    Ans: The procedure name is SUM which is function procedure.

Share :

Twitter
Back To Top

facebook main

Powered by Blogger.