Advertisement
Lisaveta777

1 - Blind 75

Aug 17th, 2022
754
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.44 KB | None | 0 0
  1. //17 aug 2022
  2. #include <stdio.h>
  3. #define SIZE 10
  4.  
  5. int main()
  6. {
  7.    
  8.     int i,j,k,target,arr[SIZE]={6,4,8,11,9,3,1,7,33,99};
  9.     target = 36;
  10.    
  11.    
  12.     for(j=0;j<SIZE-1;j++)
  13.     {
  14.         for(k=j+1;k<SIZE;k++)
  15.         {
  16.             if(arr[j]+arr[k]==target)
  17.             {
  18.                 printf("index1-%d index2-%d value1-%d value2-%d\n",j,k,arr[j],arr[k]);
  19.             }
  20.         }
  21.     }
  22.    
  23.    
  24.  
  25.     return 0;
  26. }
  27.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement