Next
0 / 21
Module DEMO-32-106DEMO-C-32

Print Array Elements

DEMO-C-32 โ€ข Programming in C

Browser-only practice

Problem Statement

Write a C program that reads an integer n followed by n integers and stores them in a 1D array. Then, the program should print all the elements of the array separated by a single space.

Example

Input:

5 10 20 30 40 50

Output:

10 20 30 40 50

Constraints

1 <= n <= 100

Input Format

An integer n, followed by n integers.

Output Format

Space-separated integers.

Sample Testcases

Submit runs every public testcase in this browser. Results and code never leave this device.

Sample #1
Public sample
5
1 2 3 4 5
1 2 3 4 5
Basic case with 5 sequential elements.
Sample #2
Public sample
1
99
99
Edge case: Array with a single element.
Sample #3
Public sample
3
-1 -2 -3
-1 -2 -3
Case with negative numbers.

Web terminal

C, C++, Java, and Python run locally in a browser VM. No worker or visualizer is used.

Saved in this browser
Editor settings