Computer Science, asked by mishrapratiksha912, 9 months ago

write a program to input any digit number and
print the reverse of that digit using
goto statement.

Answers

Answered by dibyendu16
0

 <b> <body \: bgcolor = "skyblue">

\huge\pink{\mid{\underline{\overline{ \tt Answer:-}}\mid}}

import java.util.Scanner;

class ReverseNumberWhile

{

public static void main(String args[])

{

int num=0;

int reversenum =0;

System.out.println("Input your number and press enter: ");

//This statement will capture the user input

Scanner in = new Scanner(System.in);

//Captured input would be stored in number num

num = in.nextInt();

//While Loop: Logic to find out the reverse number

while( num != 0 )

{

reversenum = reversenum * 10;

reversenum = reversenum + num%10;

num = num/10;

}

System.out.println("Reverse of input number is: "+reversenum);

}

}

<marquee direction="left" style="background:yellow"">Hope you understand please mark me as brainliest..</marquee>

\huge\mathfrak\green{Thank\:You...}

<marquee style="height:20;width:200" scrollamount="900" scrolldelay="25"><mark>Follow Me❤<mark></marquee>

Similar questions