Advertisement
MAT4m

Untitled

Jan 13th, 2019
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.85 KB | None | 0 0
  1. #include <stdio.h>//TO JEST 16
  2. #define MAX_SIZE 100
  3.  
  4. int main()
  5. {
  6. int source[MAX_SIZE], dest[MAX_SIZE];
  7. int i, size;
  8. /* Input size of the array */
  9. printf("Enter the size of the array : ");
  10. scanf("%d", &size);
  11.  
  12. /* Input array elements */
  13. printf("Enter elements of source array : ");
  14. for(i=0; i<size; i++)
  15. {
  16. scanf("%d", &source[i]);
  17. }
  18. // Copy all elements from source array to dest array
  19. for(i=0; i<size; i++)
  20. {
  21. dest[i] = source[i];
  22. }
  23. // Print all elements of source array
  24. printf("\nElements of source array are : ");
  25. for(i=0; i<size; i++)
  26. {
  27. printf("%d\t", source[i]);
  28. }
  29. // Print all elements of dest array
  30. printf("\nElements of dest array are : ");
  31. for(i=0; i<size; i++)
  32. {
  33. printf("%d\t", dest[i]);
  34. }
  35. return 0;
  36. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement