0

hi! i am trying to write a program that takes a long integer and compares every pair in that integer and displays largest pair. e.g we have an integer 23812 and in this integer largest pair is 81. so program should display 81. but i have no logic in mind for this program. please help me

5
Contributors
5
Replies
40
Views
3 Years
Discussion Span
Last Post by cheryllocascio
0
  1. Convert number to string.
  2. Create array of pairs in the string.
  3. Convert array members to integers.
  4. Iterate array to find largest member.
0

hi! rubber man. actually i and my friend are trying to solve this problem. i have a confusion that how to create pairs in the string. plz guide me

0

Sorry, but I don't do your homework for you. I provided a pseudo-code algorithm to solve the problem. Write the code, and post it here with errors that you encounter. Then we may be able to help.

0

You should look into how to get characters from strings, how to convert a group of characters into a string, how to convert a number to a string, and how to convert a string into a number. A simple goolge search should tell you how to do those things

0

I agree with the previous user that if you have such doubts in the program flow, you can simply give a search. Or you can just refer some good books providing theinformation about converting the datatypes.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.