answersLogoWhite

0


Best Answer
  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

12y ago
This answer is:
User Avatar
More answers
User Avatar

Wiki User

11y ago
  • #include
  • #include
  • void main()
  • {
  • int i,n,n1,n2,ns,r,rev=0,nr=0,nrs;
  • clrscr();
  • printf("Enter a no.n");
  • scanf("%d",&n);
  • ns=n;
  • n1=n*n;
  • n2=n1;
  • while(n2>0)
  • {
  • r=n2%10;
  • n2=n2/10;
  • rev=rev*10+r;
  • }
  • while(ns>0)
  • {
  • r=ns%10;
  • ns=ns/10;
  • nr=nr*10+r;
  • }
  • nrs=nr*nr;
  • if (rev==nrs)
  • printf("%d is an Adam no.n",n);
  • else
  • printf("%d is not an Adam no.n",n);
  • getch();
  • }
  • }
  • Read more: C_program_to_find_the_given_number_is_Adam_number

This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: C program to find the given number is Adam number?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

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

sdfsdfsfsggbcvbg


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

syntax error


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

No, thanks.


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


Program to find the greatest number?

The greatest number is infinity.


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 .


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


What is a perfect squre number?

Given a number, if you can find another number (usually smaller than the given number) when multiplied by itself yields the original given number then the original given number is a perfect square number


How do you find a perimeter of a rectangle with one number given?

If you are given the area you will have to think what do you times with the number you have to get it.