answersLogoWhite

0

  1. /* To check whether a number is Adam number or not */
  2. #include
  3. #include
  4. void main()
  5. {
  6. int i,n,n1,n2,ns,r,rev=0,nr=0,nrs;
  7. clrscr();
  8. printf("Enter a no.n");
  9. scanf("%d",&n);
  10. ns=n;
  11. n1=n*n;
  12. n2=n1;
  13. while(n2>0)
  14. {
  15. r=n2%10;
  16. n2=n2/10;
  17. rev=rev*10+r;
  18. }
  19. while(ns>0)
  20. {
  21. r=ns%10;
  22. ns=ns/10;
  23. nr=nr*10+r;
  24. }
  25. nrs=nr*nr;
  26. if (rev==nrs)
  27. printf("%d is an Adam no.n",n);
  28. else
  29. printf("%d is not an Adam no.n",n);
  30. getch();
  31. }
  32. }
User Avatar

Wiki User

13y ago

What else can I help you with?

Related Questions

Do an 8086 assembler program to find parity of a given number?

sdfsdfsfsggbcvbg


Need a'c' program to find given number is even or odd?

No, thanks.


Shell program to find the smallest digit of a given number?

syntax error


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?


How to write A Java program to print number of digits in a given number?

One way to do this is to convert the number to a String, then use the corresponding String method to find out the length of the String.


Write a c program to find given number is prime or not?

Yes, do write, or if you're too lazy to your homework, use google.


Write a program in C to find the complex number of a given number?

There is no such thing; you seem to have misunderstood something.Any real number can be regarded as a complex number with zero imaginary part, eg.: 5 = 5+0i


Write a java program to find the factorial of a given number?

Here's a simple Java program to find the factorial of a given number using a recursive method: import java.util.Scanner; public class Factorial { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); System.out.print("Enter a number: "); int number = scanner.nextInt(); System.out.println("Factorial of " + number + " is " + factorial(number)); } static int factorial(int n) { return (n == 0) ? 1 : n * factorial(n - 1); } } This program prompts the user for a number and calculates its factorial recursively.


What is the rule you can use to find the number of quarts in a given number of pints?

1 quart = 2 pints To find the number of quarts in a given number of pints, divide the given number of pints by 2 .


Program to find the greatest number?

The greatest number is infinity.


How do you write a program to find whether the given number is prime or not and show output?

#include<stdio.h> #include<conio.h> void main() { int n,a=2; clrscr(); printf("\n enter n"); scanf("%d",&n); if(i<=a-1) { if(a%i==0) { printf("\n the given number is not a prime number"); break; } i++; if(a==i) { printf("\n the given number is a prime number"); } getch(); output: enter the value of n:2 the given number is prime number


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.