Advertisement
Shishu

ABRL in c

Mar 29th, 2019
111
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 2.29 KB | None | 0 0
  1. #include<stdio.h>
  2. #include<conio.h>
  3.  
  4. void main (int xa, int xb, int ya, int yb,int xmin,int xmax, int ymin, int ymax,int Aa, int Ba, int Ra,int La, int Ab, int Bb, int Rb, int Lb)
  5.  
  6.  
  7. {
  8.     int A,B,R,L;
  9.      printf("Enter the number of xa points :");
  10.         scanf("%d",&xa);
  11.         printf("Enter the number of xb points :");
  12.         scanf("%d",&xb);
  13.         printf("Enter the number of ya points :");
  14.         scanf("%d",&ya);
  15.         printf("Enter the number of yb points :");
  16.         scanf("%d",&yb);
  17.  
  18.     printf("Enter the number of xmin points :");
  19.     scanf("%d",&xmin);
  20.     printf("Enter the number of xmax points:");
  21.     scanf("%d",&xmax);
  22.     printf("Enter the number of ymin points:");
  23.     scanf("%d",&ymin);
  24.     printf("Enter the number of ymax points:");
  25.     scanf("%d",&ymax);
  26.  
  27.     if (ya>ymax)
  28. {
  29.        Aa=1;}
  30.        else{
  31.             Aa=0;
  32.        }
  33.     if (ya<ymin)
  34.     {
  35.         Ba=1;}
  36.         else{
  37.             Ba=0;
  38.         }
  39.        if(xa>xmax)
  40.         {
  41.  
  42.  
  43.             Ra=1;
  44.             }
  45.             else{
  46.  
  47.             Ra=0;
  48.             }
  49.  
  50.  
  51.         if(xa <xmin)
  52.             {
  53.             La=1;}
  54.             else{
  55.                 La=0;
  56.  
  57.             }
  58.  
  59.  
  60.  
  61. if (yb>ymax)
  62. {
  63.        Ab=1;}
  64.        else{
  65.             Ab=0;
  66.        }
  67.     if (yb<ymin)
  68.     {
  69.         Bb=1;}
  70.         else{
  71.             Bb=0;
  72.         }
  73.        if(xb>xmax)
  74.         {
  75.  
  76.  
  77.             Rb=1;
  78.             }
  79.             else{
  80.  
  81.             Rb=0;
  82.             }
  83.  
  84.  
  85.         if(xb <xmin)
  86.             {
  87.             Lb=1;}
  88.             else{
  89.                 Lb=0;
  90.     }
  91.     if (Aa==1&& Ab==1)
  92. {
  93.        A=1;}
  94.        else{
  95.             A=0;
  96.        }
  97.  if (Ba==1&& Bb==1)
  98.     {
  99.         B=1;}
  100.         else{
  101.             B=0;
  102.         }
  103.        if (Ra==1&& Rb==1)
  104.         {
  105.  
  106.  
  107.             R=1;
  108.             }
  109.             else{
  110.  
  111.             R=0;
  112.             }
  113.  
  114.          if (La==1&& Lb==1)
  115.             {
  116.             L=1;}
  117.             else{
  118.                 L=0;
  119.                 }
  120.       printf("%d%d%d%d",A,B,R,L);
  121.  
  122. if (Aa==0&& Ba==0&& Ra==0&& La==0 && Ab==0&&  Bb==0&& Rb==0&&Lb==0){
  123.      printf("Trivally Acctepted");
  124.     }
  125. else  if (A==0 && B==0&& Ra==0 && L==0)
  126. {
  127.     printf ("Partially  Acctepted");
  128. }
  129.     else {
  130.         printf (" Trivally Rejected");
  131.     }
  132.  
  133.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement