Advertisement
Kawsar_Hossain

Array-Problem 4

Jun 21st, 2019
122
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.50 KB | None | 0 0
  1. #include <stdio.h>
  2.  int main()
  3. {
  4.     int i,n,a[50],b[50];
  5.     scanf("%d",&n);
  6.        for(i=0;i<n;i++)
  7.         {
  8.           scanf("%d",&a[i]);
  9.         }
  10.     for(i=0;i<n;i++)
  11.     {
  12.         b[i]=a[i];
  13.     }
  14.     printf("\nThe elements of the first array:");
  15.     for(i=0; i<n; i++)
  16.     {
  17.         printf(" %d", a[i]);
  18.     }
  19.     printf("\nThe elements that got copied to the second array:");
  20.     for(i=0; i<n; i++)
  21.     {
  22.         printf(" %d", b[i]);
  23.     }
  24.            printf("\n\n");
  25.     return 0;
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement