Sunday, October 3, 2010

write a program to accept the any two number and Mach its witch number is getter and less in one ?

 

void main()
{
     int a,b,c,d;
     clrscr();
     printf("\n\t Enter the Value of A\t:\t");
     scanf("%d",&a);
     printf("\n\t Enter the Value of B\t:\t");
     scanf("%d",&b);
     c=a-b;
     d=c+abs(c);      // to check if the difference is negative or not
     if(d==0)
     printf("\n\t\t\t\t * Answer *");
     printf("\n\t A is smaller than B");
     else
     printf("\n\t A is bigger than B");
     getch();
}

No comments: