#include<stdio.h>
#include<conio.h>
void main()
{
int n1,n2,com=0,i,j,com9=0,n,m;
clrscr();
printf("\n\n\t\t YOU ENTER VALUE IN DECIMAL MEANS (0-9)\n\n");
printf("\n PLEASE ENTER THE VALUE OF N1:= ");
scanf("%d",&n1);
printf("\n PLEASE ENTER THE VALUE OF N2:= ");
scanf("%d",&n2);
for(i=1,j=9;i<n2;i=i*10,j=j+(9*i))
{
n=i;
m=j;
}
printf("\nI=%d \n j=%d",i,j);
printf("\nn=%d \n m=%d",n,m);
com=m-n2;
printf("\n IT IS VALUE OF COMPLEMENTED %d",com);
com9=n1+com;
if(com9>m)
com9=com9-i+1;
printf("\n\n\tIT IS THE VALUE OF 9`S COMPLEMENT %d",com9);
getch();
}