answersLogoWhite

0

import java.io.*;

class kaprekar

{

public static void main(String args[])throws IOException

{

BufferedReader br=new BufferedReader(new InputStreamReader(System.in));

System.out.println("Enter any number");

int n=Integer.parseInt(br.readLine());

int t=n,count=0;

while(n!=0)

{

n=n/10;

count++;

}

int s=t*t;

int p=(int)Math.pow(10,count);

int ld=s%p;

int minus=s-ld;

int fd=minus/p;

int sum=fd+ld;

if(sum==t)

{

System.out.println("Kaprekar Number");

}

else

{

System.out.println("Not a Kaprekar number");

}

}

}

User Avatar

Wiki User

14y ago

What else can I help you with?

Related Questions

Write a C program called MonthDays to find the number of days in a given month Test your code with different input values to demonstrate that your function is robust?

Write a C program called MonthDays to find the number of days in a given month Test your code with different input values to demonstrate that your function is robust?


Program to find the greatest number?

The greatest number is infinity.


What is the coral 12 activation code?

I am needing to find the code to use a coral paintshop pro program


Where can I find my trusted traveler number?

You can find your trusted traveler number on the back of your Trusted Traveler Program card or in your online account on the program's website.


How do you dump any program code on micro controller 89c51?

In order to dump any program code onto a micro controller for a 89c51, you would first have to find access to the main controller board of the item, and plug the program code directly into that.


Java source code to find prime number?

/* Program to Find whether number is Prime or Not. */ class PrimeNo{ public static void main(String args[]){ int num = Integer.parseInt(br.readLine()); int flag=0; for(int i=2;i


Can you get a Java program to find the cube of a number?

Yes


How do you find bugs in a computer program?

Typically, you run the program through "debuggers" - software that specifically looks for errors in your code.


How do you find a phone number zip code?

The easiest way to search for a phone number are ode or a zip code for a phone number is to search the phone number area code on google for the zip code.


Find ifsc code using account number?

To find the IFSC code, you will not be able to use the account number but will need the name of the bank and location.


Write a shell program to find given no is even or odd?

The pseudo code would be as follows (you figure out the syntax) 1) Prompt the user to enter a number 2) If entered number is alpha, quit program after displaying message that the user ended the program. 3) Otherwise, find Modulo 2 of the entered number. This is a fancy way of saying "find the remainder when the number is divided by 2) 4) If Modulo 2 is zero, the number is even, otherwise odd 5) Display message showing if the entered number was Even or Odd 6) Branch back to step 1


Where do you find Epiphone product code number?

The code seems to be in the box of the guitar, the big number above the barcode.