Vampire Number in Java
Source Code for Vampire number:
import java.util.*;
class Number
{
public static void main(String args[])
{
Scanner sc=new Scanner(System.in);
int n,i,c=0,f=0,j=0,x,k,p,c1,c2;
System.out.println("Enter a number:");
n=sc.nextInt();
//Counting the number of digits
for(i=n;i>0;i/=10)
c++;
if(c%2!=0)
f=1;
else
{
for(i=(int)Math.pow(10,c/2-1);i<(int)Math.pow(10,c/2);i++)
{
if(n%i==0) //i is one factor
{
j=n/i; //j is another factor
if(!(j>=Math.pow(10,c/2-1) && j