Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- int main ()
- {
- int i , j , v1[5] , v2[5] ;
- printf ("Vector #1:\n") ;
- for (i = 0 ; i < 5 ; i++)
- {
- printf ("Introduza o %dº número: " , i + 1) ;
- scanf ("%d" , &v1[i]) ;
- }
- printf ("Vector #2:\n") ;
- for (i = 0 ; i < 5 ; i++)
- {
- printf ("Introduza o %dº número: " , i + 1) ;
- scanf ("%d" , &v2[i]) ;
- }
- printf ("Comuns :") ;
- for (i = 0 ; i < 5 ; i++) for (j = 0 ; j < 5 ; j++) if (v2[i] == v1[j]) printf (" %d" , v1[j]) ;
- printf ("\n") ;
- return 0 ;
- }
Advertisement
Add Comment
Please, Sign In to add comment