Questions tagged [digit]

Anything related to numerical digits, i.e. the symbols used to write the representation of a number in a number system, such as decimal, hexadecimal, octal or binary systems.

Anything related to numerical digits, i.e. the symbols used to write the representation of a number in a number system, such as decimal, hexadecimal, octal or binary systems.

See Wikipedia page on numerical digits.

375 questions
-3
votes
3 answers

Find char in string that is a digit and larger or equal to 2

I have a string that contains numbers like: 02101403101303101303140 how can I iterate the string to check whether the number in string is >= 2 and remember that number's index in array or list for further processing? the further processing should be…
lkallas
  • 1,310
  • 5
  • 22
  • 36
-3
votes
2 answers

How to get number of digits in an integer with leading zeros in java?

This question includes numbers with leading zeros and numbers which normally counted as hexadecimal(like 09).Assume user input is integer,because i pass number to some function as integer. For example if user inputs 5 i should get 1 if user…
Wardruna
  • 198
  • 4
  • 23
-3
votes
1 answer

Finding Two Bases Which When Converted to Base 10 Are Equal

I have a very challenging problem here today. I cannot think of a way to solve it. Given 6 numbers as input: a1, a2, a3, b1, b2, b3, find 2 numbers X and Y such that a1 * x^2 + a2 ^ x + a3 = b1 * y^2 + b2 * y + b3. X and Y must be between 10 and…
Bob Billy
  • 285
  • 1
  • 6
-3
votes
1 answer

c++ projecteuler #4 code mistake

I'm trying to solve the problem given in Project Euler #4: A palindromic number reads the same both ways. The largest palindrome made from the product of two 2-digit numbers is 9009 = 91 × 99. Find the largest palindrome made from the product of…
Ankesh
  • 27
  • 1
-3
votes
2 answers

How can I get each digit of a 16 digit number and store each digit as a variable?

I need to write a Java program that validates credit card numbers, and to do that I need to preform operations on each individual digit. How can I get these digits, without using strings or arrays?
Bottlecaps
  • 129
  • 1
  • 2
  • 10
-3
votes
1 answer

Find missing numbers in array

I have an php array of 99 numbers. The array contains the digits 1 to 100 with one digit missing. How to know the missing number?
Chinmay235
  • 3,236
  • 8
  • 62
  • 93
-4
votes
2 answers

C# - How to show every combination of a 3 decimal placed number (4 numbers outside of the decimals)

I am wondering how to write all the possible combinations of a number with 3 decimals in it. As you might have guessed I am using this for IP addresses, so I need the numbers for the 4 decimal places to be between 0 and 255. Is there any way I can…
Jkaay
  • 11
  • 4
-4
votes
2 answers

How to get specific substring digit from string using php?

$fileName = "Backup_1486874341.tar.gz" Here is my file name. How can i get only timestamp from that file name Like 1486874341
sharif779
  • 174
  • 2
  • 10
-4
votes
1 answer

How to reduce textsize of a number (to display entire number) in a textview as it gets longer?

I saw other answers to questions very similar to this one. However, I want the display of my calculator to show normal number till 13 digits and then when 14th digit is added, start showing in scientific notation. Also, I want the size of text to…
Raunaq Shah
  • 75
  • 1
  • 8
-4
votes
4 answers

Program in C that checks a number's digit subsequences

i need to make a program that for example when given the number 879 must check whether the number is prime and whether all its digits subsequences are prime meaning 87,79,8,7,9 etc. So far i've made a function thats check whether a number is prime…
loukdi
  • 9
  • 2
-4
votes
2 answers

How do you assign a number in an array a value?

I am trying to convert the tenth digit of an array to a number (10) if it is the value 'x'. I have tried... if (array[9] === 'x') { 'x' === 10; }; Thanks
-5
votes
3 answers

Python - How to show addition of integers digits

I want to show in a line the addition of the digits of a positive integer. For example if input is 4316 I want it to output 4+3+1+6 Also the input can be any x amount of digits.
FriendlyCoder
  • 103
  • 1
  • 1
  • 6
-5
votes
2 answers

validate digit in java, error using length

I tried to validate digit and make this function. public int digitCheck(String string) { int flag=0; for(int i=0;i
greenthunder
  • 697
  • 8
  • 19
  • 34
-5
votes
1 answer

Writing a loop with a step size 10, to print out all 2-digit numbers ending in 7 in increasing order in python

Write a program, using a for loop with step size 10, to print out all 2-digit numbers which end in 7, in increasing order I have no idea where to start, or how to do this. help please!
-6
votes
2 answers

Finding the last digit of a very large 2^n number

As the title sais, i want to find the last digit of an 2^n number. I know that it's about repetition of even numbers, but i don't know how to make it happen. This is what I did: return (2*ascii%10)%10 - 2; But it's not the correct method For…
Mas
  • 11
  • 5
1 2 3
24
25