Professional Documents
Culture Documents
Algorithm-
number
{
s=s+i;
3. if(s==a)
// to check the number formed by above
calculations is equal
to original number
4.If the condition is true then display(number is perfect)
else (number is
not perfect)
5. Stop.
number
s=s+d;
the number
p=p/10;
the last digit
4. if(s==a)
// to check the number got after above
calculations is equal to
original number
5. If the condition is true then display(number is neon)
else (number is
not neon).
6. Stop.
3. if(c==0)
// to check the value of c
4. If the above condition is true then display (number is
prime) else
(number is not prime).
5. Stop.
Ques11-
if(n==s)
System.out.println("Armstrong Number");
else
System.out.println("Not Armstrong Number");
}
}
}
4. if(n==s)
6. Stop.
else
System.out.println("Nubmer is not pallindrome");
}
}
greater than 0
{
r=r*10+d;
and d is added
to it so as to convert d to
tens digit
a=a/10;
4. if(k==r)
equal to new
is true than
print it is
palindrome
else
System.out.println("Nubmer is not pallindrome"); // if condition is
System.out.println("Twin Prime");
else
System.out.println("Not Twin Prime");
}
}
itself
p=1;
to p
}
for(j=2;j<b;j++)
{
if(b%j==0)
assign 1 to t
// checks whether
prime or not
// if above condition is
// if above condition is
not twin
prime
5. Stop.
{
p=r%10;
if(p!=0)
{
System.out.print(p);
}
r=r/10;
}
}
}
d=a%10;
r=r*10+d;
a=a/10;
digit
}
greater than 0
{
p=r%10;
if(p!=0)
{
System.out.print(p);
the number
}
r=r/10;
4. Stop.
System.out.println("Number is special");
else
System.out.println("Number is not special");
}
}
than 0
{
d=n%10;
number
for(i=1;i<=d;i++)
{
f=f*i;
number stored
in d or finds the factorial of the
number stored in d
}
s=s+f;
// assign 1 to f
4. if(s==a)
stored in s is
number or not
System.out.println("Number is special");
// if above condition is
false then
print
number is not special
5. Stop.
}
}
}
}
0
{
d=m%10;
if(d==i)
{
System.out.print(d);
d
}
m=m/10;
}
}
3. Stop.