Skip to main content

write a GW or Q BASIC program to receive a number from keyboard and display the number of digits of the number

10 input "Enter value      ";x#
20 let n$ = strs(x#)
30 let d=len(n$) - 1
40 print "Digit = ";d
50 print
60 goto 10
70 end





---------------------------------------------------Output-------------------------------------------------------
Enter value      : 325612

Digit  = 6

Comments

Post a Comment

Popular posts from this blog

Class x_ Blue j java question solve(Important)

Section – A Answer any four of the following : 1 . Write a Program to calculate charges for sending particles when the charges are as follows For the first 1KG  Rs.15.00  , For additional weight , for every 500gm or fraction thereof: Rs 8.00 Ans class Prog1 { static void test(double wt)//user enters the weight in KGs { System.out.println(“Parcel  Weight is “+wt); int icharge = 15; System.out.println(“Initial  charge is “+icharge); int rwt = (int)((wt-1)*1000); System.out.println(“Remaining  weight after deducing 1Kg “+rwt); int rcharge = (rwt/500)*8; System.out.println(“Charge  excluding fractional part is Rs.”+(icharge+rcharge)); int fcharge = (rwt%500>0)?8:0; System.out.println(“Charge  for fractional part is Rs. “+fcharge); int tcharge = icharge+rcharge+fcharge; System.out.println(“Total  Charge is Rs. “+tcharge); } } 2 . A special two-digit number is such that when the sum of its digits is added to the product of its digits , the res...