hello everyone.
i have a problem but i can not solve it.
it is below:
-----
A Credit Card company uses a method to generate its own valid Card Numbers. Given 7-digit Customer Number, a Card Number is generated, consisting of 9 digits. The method is as follows:
It gets the 3-digit number from the middle of the given Customer Number,
It takes the square of this 3-digit number
It adds one to this square if the first digit of the Customer Number is EVEN.
It appends the last two digits of the result to the end of the Customer Number.
Example:
Given Customer Number: 1234567
Number to be squared: 345
Square of it: 345 * 345 = 119025
Last two digits: 25
Resulting Card Number: 123456725
Write a C program that will input a 9-digit Credit Card Number, and will check whether it is valid or not (i.e. to examine if the last 2 digits of the Credit Card Number can be generated from the first 7 digit number)
Hint: use ‘long’ data type
----
we only see, if and switch and also some data types, we can use long, int, double, scanf.
can anyone help me? it is urgent!!!
i can not do this step!!
**
It gets the 3-digit number from the middle of the given Customer Number,
**
How can i get this?????????