answersLogoWhite

0

How do you set rules for the last two digits of a number?

Updated: 8/17/2019
User Avatar

Mrman208

Lvl 1
14y ago

Best Answer

I assume you are using C.

I also assume that you stored the input in an int.

All you need to do is store that int into an array.

You can do this using itoa.

Just search about it.

When you have done this, use the index of the last two digits of the array to check their values.

If the number of digits is not definite, create a loop like this to count the number of digits:

array digits[MAX];

int c = 0;

while(array[c]!=null)

{

c++;

}

// c will then be the number of digits.

example:

inputted digit: 12345

// the value of c is now 4

//Take note that the index of arrays is 0

//index: [0][1][2][3][4]

//values: [1][2][3][4][5]

To access the last two digits:

digits[4] // this is 5

digit[3] // this is 4

User Avatar

Wiki User

14y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: How do you set rules for the last two digits of a number?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

What are the numbers on a credit card?

A typical credit card has sixteen numbers. The first set of six digits number is the issuer identifier, and the last digit number is called the check digit that is generated to satisfy certain conditions. The set of nine digits number left in the middle is the account number of the credit card. www.creditcardshelplines.com


What is the number in a a sequence?

The one closest to the Middle if your sequence is of an even set of digits. The median will be a specific number if you have a sequence of odd digits.


Is the security code on back of a Visa card the first set of four numbers or the last three numbers?

The security code on any credit card would be the last set of digits on back of the card with is the three digit number


What are examples of finite and infinite sets?

Some finite numbers in a set: the number of digits on your hand, the number of seats on a bus, and the number of people on earth. Some infinite numbers in a set: the number of positive integers and the number of digits in pi.


Are repeating decimals an irrational number?

A repeating decimal is a rational number. Its value is(the repeating set of digits)/(as many 9s as there are digits above).


Is 189 divisible by 2 3 4 5 6 9 and 10?

No. 189 is only evenly divisible by 3 and 9 (from the set provided). Using the following rules of divisibility on the number 189: Divisible by 2? No - the number is not even Divisible by 3? Yes - the sum of the digits (1 + 8 + 9 = 18) is divisible by 3 Divisible by 4? No - the last two digits are not evenly divisible by 4 Divisible by 5? No - the last digit is not a 0 or a 5 Divisible by 6? No - the number is not even Divisible by 9? Yes - the sum of the digits is divisible by 9 Divisible by 10? No - the number is not divisible by 2 or 5


How a check digit is calculated?

Check digits are determined (or derived) by a set algorithm using the digits of the account number.


What is an even number between 12 and 29 with digits whose difference is 7?

18 is an even number between 12 and 29 with digits whose difference is 7. To answer this question, we start with the last part "difference is 7" and come up with a set of values that meet the need as follows: 18 29 [29 is in the set only if the question is inclusive] Now, there is only one even number in the pre-solution set and that number is 18.


What set of digits represents the operating budget account number?

25


How many significant digits are in an exact number?

There's no set amount. The answer varies with each number.


What set of digits represents the operating budget account number OBAN?

25


What set of digits represent the accounting and disbursing station number adsn?

667100