Tuesday, July 28, 2009

How to compare two ten digit numbers?? please suggest any good algorithm or possible c language code..?

say for an eg.. If i wanna compare two mobile numbers, how can i compare... ??? though it is a simple question, wanna know it in C language....

How to compare two ten digit numbers?? please suggest any good algorithm or possible c language code..?
why not just read the two numbers into two 10 char arrays and then do a strncmp on it?





If they are equal, the strncmp function will return a 1 and if they are not equal, the strncmp function will return a 0.


No comments:

Post a Comment