
- Forum
- Programming Talk
- C and C++
- please give logic of this program
please give logic of this program
This is a discussion on please give logic of this program within the C and C++ forums, part of the Programming Talk category; Write recursive function for this program , Delete FIRST digit , Input 4523 Output 523 ?...
-
07-15-2009, 11:28 AM #1
- Join Date
- Jul 2009
- Answers
- 1
please give logic of this program
Write recursive function for this program ,
Delete FIRST digit , Input 4523 Output 523 ?
Last edited by AMAR.BOGARI; 07-15-2009 at 11:38 AM.
-
Using recursion and int
If it allows you to use ints... it is pretty simple to do
...
Code:int deletefirst(int n) { int temp; if (n<10) return 0; // delete the first digit else { temp=n%10;// save the last digit n=n/10;//changes n return delete(n)*10+temp;// goes until n<10 and then rebuilds the number } }

Reply With Quote





