number is automorphic or not

//to check number isautomorphic or not return type and arguement
#include<stdio.h>
#include<conio.h>
void input();
int process(int);
void output();
int no,i,sqr,r1,r2,flag,x;
void main()
{
clrscr();
input();
getch();
}
void input()
{
printf(“enter your no:”);
scanf(“%d”,&no);
x=process(no);
output(flag);
}
int process(int no)
{
i=no;
sqr=i*i;
for(;i>0;i=i/10,sqr=sqr/10)
{
r1=i%10;
r2=sqr%10;
if(r1!=r2)
{
flag=0;
break;
}
else
flag=1;
}
return x;
}
void output(int flag)
{
if(flag==1)
printf(“automophic”);
else
printf(“not automophic”);
}

Leave a Reply

Your email address will not be published. Required fields are marked *