answersLogoWhite

0

One way to do this is to convert the number to a String, then use the corresponding String method to find out the length of the String.

User Avatar

Wiki User

15y ago

What else can I help you with?

Continue Learning about Engineering

How write a program to input any number and display digits which are absent in given number?

To write a program that inputs a number and displays the digits absent in it, you can follow these steps: Convert the input number into a set of its digits. Create a set of all possible digits (0-9). Subtract the set of digits from the complete set to find the missing ones. Display the missing digits. Here’s a simple example in Python: number = input("Enter a number: ") present_digits = set(number) all_digits = set('0123456789') missing_digits = all_digits - present_digits print("Missing digits:", ''.join(missing_digits))


C program to print inverse of a given number?

Inversing of a given Number. suppose we gave input 123456 then the output of the program will be 654321./*mycfiles.wordpress.comC program to print inverse of a given number*/#include#includevoid main(){long int n,rn=0,d=0;clrscr();printf("Enter the number\n\n");scanf("%ld",&n);while(n>0){d=n%10;rn=rn*10+d;n=n/10;}printf("%ld",rn);getch();}


How do you write a program in qbasic to input 64751315 to sum?

In QBASIC, you can write a simple program to input the number 64751315 and sum its digits as follows: DIM sum AS INTEGER sum = 0 INPUT "Enter a number: "; number FOR i = 1 TO LEN(number) sum = sum + VAL(MID$(number, i, 1)) NEXT PRINT "The sum of the digits is "; sum This program prompts the user to input a number, iterates through each digit, converts it to an integer, and adds it to the total sum, which is then printed out.


How do you print number in digits in c language?

for (first=n; first>=10; first/=10);


You are write a program that will read a list of number in the range from 1to n and will print for each number the corresponding term in cantor's enumeration as given no blank line should appear last?

see pages 43-49 in Principles of Program design by M. A. Jackson, 1975

Related Questions

How write a program to input any number and display digits which are absent in given number?

To write a program that inputs a number and displays the digits absent in it, you can follow these steps: Convert the input number into a set of its digits. Create a set of all possible digits (0-9). Subtract the set of digits from the complete set to find the missing ones. Display the missing digits. Here’s a simple example in Python: number = input("Enter a number: ") present_digits = set(number) all_digits = set('0123456789') missing_digits = all_digits - present_digits print("Missing digits:", ''.join(missing_digits))


C program to fine the largest of 10 given number?

first sort the ten numbers in descending order and print the first number. That will be the largest no


C program to print inverse of a given number?

Inversing of a given Number. suppose we gave input 123456 then the output of the program will be 654321./*mycfiles.wordpress.comC program to print inverse of a given number*/#include#includevoid main(){long int n,rn=0,d=0;clrscr();printf("Enter the number\n\n");scanf("%ld",&n);while(n>0){d=n%10;rn=rn*10+d;n=n/10;}printf("%ld",rn);getch();}


Algorithm for to find sum of individual digits of a positive integer?

enter the number whose digits are to be added num is the given value num=0! k=num%10 sum=sum=k k=num/10 num=k print the sum of the digits


How do you write a program in qbasic to input 64751315 to sum?

In QBASIC, you can write a simple program to input the number 64751315 and sum its digits as follows: DIM sum AS INTEGER sum = 0 INPUT "Enter a number: "; number FOR i = 1 TO LEN(number) sum = sum + VAL(MID$(number, i, 1)) NEXT PRINT "The sum of the digits is "; sum This program prompts the user to input a number, iterates through each digit, converts it to an integer, and adds it to the total sum, which is then printed out.


C plus plus program to print sum of uppercase digits?

Good luck. I don't think it is possible, since there is no such thing called upper case digits.


What is the first million digits of pi?

There is a computer program that will print out the value of pi to even more decimal places than that.


WAP to find Armstrong Number?

An Armstrong number (or narcissistic number) is a number that is equal to the sum of its own digits each raised to the power of the number of digits. For example, 153 is an Armstrong number because (1^3 + 5^3 + 3^3 = 153). To find Armstrong numbers in a given range, you can iterate through each number, calculate the sum of its digits raised to the power of the number of digits, and check if it equals the original number. Here's a simple Python code snippet: def is_armstrong(num): digits = [int(d) for d in str(num)] return num == sum(d ** len(digits) for d in digits) # Example usage for i in range(1000): if is_armstrong(i): print(i)


How many digits are used to print from 1 to 11521?

To find the total number of digits used to print the numbers from 1 to 11,521, we can break it down by the number of digits in each range. From 1 to 9 (9 numbers) uses 9 digits, from 10 to 99 (90 numbers) uses 180 digits, from 100 to 999 (900 numbers) uses 2,700 digits, and from 1,000 to 11,521 (10,522 numbers) uses 42,088 digits. Adding these together, the total is 9 + 180 + 2,700 + 42,088 = 44,977 digits.


How do you prepare a program in basic to display the word and the number of letters in it when is given as input?

10 cls 20 input"enter word";word$ 30 print word$ 40 print len(word$) 50 end this program is for GW BASIC for other BASIC's the line numbers are optional.


How do you print number in digits in c language?

for (first=n; first>=10; first/=10);


C plus plus program to print number patterns?

bghjg