Want this question answered?
public static void main(String[] args) { int val = 100; int val1 = 50; System.out.println("Number of digits in " + val + " is: " + new String(val + "").length()); System.out.println("Number of digits in " + val1 + " is: " + new String(val1 + "").length()); }
seq 1 2 99
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.
program that take three decimal number as input and find the largest among them in assembly language
// Define and initialize input buffer char inputBuffer[256]; memset(inputBuffer, '\0', 256); // Get input scanf("%s", inputBuffer); // Display exactly what the user typed in printf("%s\n", inputBuffer);
public static void main(String[] args) { int val = 100; int val1 = 50; System.out.println("Number of digits in " + val + " is: " + new String(val + "").length()); System.out.println("Number of digits in " + val1 + " is: " + new String(val1 + "").length()); }
It reduces the number of digits after the decimal point in the display, rounding the number as appropriate.
As of January 25, 2014, the largest known prime number was calculated to be 257,885,161 − 1; a number containing 17,425,170 digits. This is, of course, too large to display.
Write a program which takes any number of days from the user. the program should display the number of years, number of months formed by these days as well as the remaining days.
No. An irrational number is one that does not repeat or finish, and a calculator cannot display millions of digits like an irrational number would have.
A 24 hour clock displays digits whose sum total equals the number of led's used to display them 94 times a day. A 12 hour clock displays them 108 times a day.
no thanks
write a program to display your name age class schoolname e-mail 2hobby based on choice
This happens because the contribution of the smaller number is lost in the trailing decimal digits. Suppose you had a calculator that could display 10 digits. Suppose you tried to add 123,456.789 and 0.000 000 12 The true answer is 123,456.789 000 12 but, since you can only display 10 digits, the answer shows as 123,456.7890 which is the larger number. The exact details will depend on the number of displayed digits.
To count the number of times a digit occurs in an integer, start by initializing an array of ten counts of digits, such as int digits[10];Then, in a loop while the number is non zero, increment the element in the digits array that corresponds to the units digit, and then divide the number by ten, such as digits[number%10]++ and number/=10;int digits[10];int i;int number = some number;for (i=0; i
There is no upper limit to numbers, there are some astronomical numbers with more digits than the universe has atoms (See Graham's number) used in math. On many calculators, the largest number it can calculate is limited by the number of digits your calculator can display. If it can display 12 digits, the largest number you can calculate on it is 999,999,999,999. The scientific calculators which support scientific notation can usually calculate numbers up to 9.999999 x 1099. Some high-tech ones can go up to 9.99999 x 10999. On the other hand, I use a professional program used to crunch numbers and the largest number it says it can express is 1.920224672692357 x 10646456887 (or 22147483296). Not that I think I would need to use such a large number any time soon.
Your question is a little vague, but it sounds like a display issue. Specifically, it sounds like you have your number display set to show zero digits past the decimal point. Simply select the cell you're interested in reformatting, click on Format/Cells/Number/Percentage and make sure you have it set to display at least one (if not more) decimal digits.