answersLogoWhite

0

In java you can do it like this:

import java.util.Scanner;

public class Sample {

public static void main(String[] args) {

Scanner input = new Scanner(System.in);

System.out.print("Input an integer: ");

int i = input.nextInt();

System.out.print("reverse:");

while(i != 0) {

System.out.print(i % 10);

i = i / 10;

}

}

}

User Avatar

Wiki User

16y ago

What else can I help you with?

Related Questions

Why do you need type conversion operations?

Type conversion operations are mainly used for specified output for the program. Eg: the input is two float values in addition, but the output needed is an integer In this case we need the type conversion operation done for the program to get an integer value else the output will be float value.


Write a program that prompts the user to input a positive integer It should then output a message indicating whether the number is aprime or not?

Output a prompt.Either:Read from standard input (std::cin) to an integer.Or:Read a line from standard input (std::getline()) to a string.Create a string stream (std::stringstream) to read the string.Read from the string stream to an integer.For each integer from 2 to half the entered integer:If the entered integer is divisible by the current integer:The number is not prime.Exit the program.The number is prime.Exit the program.


Will the output of ADC be an integer or will it be a decimal also?

You will have to determine its scaling factor. The output of the ADC is a number, you can interpret it anyway that is necessary for the system it is in.


What is accuracy of a good program?

It depends on to what level of accuracy you tend to have with the output of your program Accuracy can be treated as: (Desired Output / Actual Output of your Program)


Which documentation is typically written first input output internal program or external program?

Output documentation


What is input -output bound program?

input output bound program is a program (or process in precise way), which spends most of time allocated to it for execution, on input/output devices and need very small CPU time for it.


Can A Computer Output Electricity In Computercraft you can say if true output power on this side Can you say in a program to output power say to light a light So if true then output power to led's?

A Computer Output Electricity in Computercraft cannot be said to make a program to output power, regardless of the side.


How do you append a output of a program to a program?

you mean like show some sample output? Just put it in comments at the bottom. Run the program, and in the top left of the command prompt there is a button you can click. Select mark, highlight the output, then select copy. Paste it onto the end of the program.


What is a extra copie of a document or a program?

It is an output!


How do you write a program with do while loop so that the output is 123456 equals 720?

How do you write a program with do while loop so that the output is 123456 =720


What are the two parts of compilation?

1) source program to object program 2)object program to object program output


What are the Example Output of Calculator Program in C plus plus?

example output of c++ calculator