QB Sample
QB Sample
7. Write a program to calculate the product of each digit of user entered the
digit.
cls
input “ Enter any number”;n
p =1
while n <> 0
r = n mod 10
p = p*r
n = n / 10
wend
print
print “Product of each digits”;p
end
1 cls
22 for i = 1 to 5
333 for j = 1 to i
4444 print i;
55555 next j
print
next i
end
55555 cls
4444 for i = 5 to 1 step -1
333 for j = 1 to i
22 print i;
1 next j
print
next i
end
54321 cls
5432 for i = 1 to 5
543 for j = 5 to i step -1
54 print j;
5 next j
print
next i
end
54321 cls
4321 for i = 5 to 1 step -1
321 for j = i to 1 step -1
21 print j;
1 next j
print
next i
end