Recent Posts

9-latest-250px-course

Write a C program to Check whether a number is Automorphic number or not

Write a C program to Check whether a number is Automorphic number or not



Program:-     

#include<stdio.h>

bool isAutomorphic(int N)
{
int sq = N * N;
while (N > 0)
{
if (N % 10 != sq % 10)
return false;
// Reduce N and square
N /= 10;
sq /= 10;
}
return true;
}

int main()
{
//Fill the code
int N;
scanf(“%d”,&N);
isAutomorphic(N) ? printf(“Automorphic”) : printf(“Not Automorphic”);
return 0;
}

Output:-

....
SHARE

Milan Tomic

Hi. I’m Designer of Blog Magic. I’m CEO/Founder of ThemeXpose. I’m Creative Art Director, Web Designer, UI/UX Designer, Interaction Designer, Industrial Designer, Web Developer, Business Enthusiast, StartUp Enthusiast, Speaker, Writer and Photographer. Inspired to make things looks better.

  • Image
  • Image
  • Image
  • Image
  • Image
    Blogger Comment
    Facebook Comment

0 comments:

Post a Comment