Purchase Solution

Reversing integer using recursion

Not what you're looking for?

Ask Custom Question

I need a recursive function that accepts an integer and returns its reverse.

for example

int reverse( int n );
int main()
{
int n;
n = reverse (123) ; // this returns 321

}

I can do this easily without recursion but I have to use recursion.
Thank you.

Purchase this Solution

Solution Summary

The expert examines reversing integers using recursion.

Solution Preview

#include "stdafx.h"
#include <iostream>

using namespace std;

static int reverse (int n) ;
static ...

Purchase this Solution


Free BrainMass Quizzes
Word 2010: Table of Contents

Ever wondered where a Table of Contents in a Word document comes from? Maybe you need a refresher on the topic? This quiz will remind you of the keywords and options used when working with a T.O.C. in Word 2010.

Word 2010: Tables

Have you never worked with Tables in Word 2010? Maybe it has been a while since you have used a Table in Word and you need to brush up on your skills. Several keywords and popular options are discussed as you go through this quiz.

Java loops

This quiz checks your knowledge of for and while loops in Java. For and while loops are essential building blocks for all Java programs. Having a solid understanding of these constructs is critical for success in programming Java.

C++ Operators

This quiz tests a student's knowledge about C++ operators.

Javscript Basics

Quiz on basics of javascript programming language.