answersLogoWhite

0

class reverse

{

public static void main(String args[])

{

int a=0;

int b=Integer.parseInt(args[0]);

while(b!=0)

{

int n=b%10;

a++;

System.out.println(n);

b=b/10;

}

System.out.println("\n digits are..." + a);

}

}

by this prog u can reverse the nos. as well as it also helps u to count all digits.

from

ruchika jaiswal

User Avatar

Wiki User

15y ago

What else can I help you with?

Related Questions

How do you wrte a program to compound interest?

#include


How do you wrte aC program in Linux?

OK. Done that


How do you wrte a program find 28 in c?

int x= 28;


How do you wrte a program for traveling salesman?

There are several free programs available for this sort of problem


Program for print reverse string of given number in java?

public class StringReverseExample { public static void main(String[] args) { int num=1001; int n=num, rev; while(num!=0) { int d=num%10; rev= (rev*10)+d; num=num/10; } System.uot.println(rev); } }


Reverse the order of separate numbers without using array or list exinput 5 7 9 1 output 1 9 7 5?

main() { int no,reverse=0,digit; scanf("%d",no); for( ;no>0; ) { digit=no%10; reverse=reverse*10 + digit; no=no/10; } printf("%d",reverse); }


How to write a program in python to print the reverse of a number?

In python, type the following into a document. NOTE: Sentences following a # symbol are comments, and are not necessary for the program to run. #!/usr/bin/python #This program takes a input from a user and reverses it. number = input("Type a number: ") #This takes input from a user. a = len(number) #This finds the length of the number reverse = "" #This sets the variable reverse to an empty string. for i in number: a = a-1 #The places in a string start from 0. The last value will be the length minus 1.reverse = reverse + number[a] #Makes the number's last digit the new string's first. print("The reverse of", number, "is", reverse + ".") #prints the resulting string. This program will take any sequence of characters and reverse them. The final value is a string, but if an integer is needed, one needs only to add the line reverse = int(reverse) above the print statement. However, this will stop the program from being able to reverse strings, as it is not possible to convert a string to an integer if it is not a number.


Which is the smallest three digit number which does not change even if the digit are written in reverse order?

000 i think


What is the use of Reverse String in C program?

The use of the reverse string in C program is used to reverse the letters in the string. An example would be reverse me would be reversed to em esrever.


How do egyptians wrte?

hieroglyphics


Write a program to convert a 2 digit BCD number into hexadecimal number?

Write a program to convert a 2-digit BCD number into hexadecimal


I am a 3 digit number I am divisible by 3 My hundreds digit is one third my tens digit If you reverse me i am divisible by 6 what am i?

261, 264, or 267