Advertisement
Guest User

Untitled

a guest
Jan 22nd, 2017
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.56 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. #include <time.h>
  4.  
  5. int main()
  6. {
  7.     int a[10];
  8.     int b[10];
  9.     int i, j;
  10.     srand(time(NULL));
  11.    
  12.     for(i = 0; i < 10; i++) {
  13.         a[i] = rand() % 20;
  14.         b[i] = rand() % 20;
  15.        
  16.     }
  17.     for (i = 0; i < 10; i++) {
  18.         for (j = 0; j < 10; j++) {
  19.             if (a[i] == b[j])
  20.             printf ("to %d vre8hke sthn 8esh %d tou prwtou pinaka kai sti 8esi %d tou deuterou\n ", a[i], i+1, j+1);       
  21.         }
  22.     }
  23.     printf("\n");
  24.     for(i = 0; i < 10; i++) {
  25.         printf("%p ", &a[i]);
  26.     }  
  27.     printf("\n");
  28.     for(i = 0; i < 10; i++) {
  29.         printf("%p ", &b[i]);
  30.     }
  31.    
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement