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");
}
}
}
Chat with our AI personalities
The greatest number is infinity.
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.
Yes
#include
You can find the source code of the menu driven graphics program here: http://www.start2code.com/Cresources/menu-driven-graphics-program-c.html