Print Array

You are given an integer array nums of size N.

Your task is to print all the elements of the array in the same order as they appear, separated by spaces.

Example 1:

Input:

nums = [10, 20, 30, 40, 50]

Output:

10 20 30 40 50

Example 2:

Input:

nums = [-5, 0, 15, -10]

Output:

-5 0 15 -10

Now Your Turn!

Pick the correct output for the given input

Input:

nums = [3, 2, 6, -6, 2]

Still unsure what the problem is asking ?

Let’s go through a few more examples, step by step, to make it clearer.

Constraints:

  • 1 <= N <= 100
  • -105 <= nums[i] <= 105

Hints

Frequently Occurring Doubts

Interview Follow-up Questions

0
class Solution {
public:
void printArray(int arr[], int N) {
// Write your logic here
}
};
 
 
Test Case

Input:

Nums