Problem Statement
Write a C program to modify a 1D array by replacing all negative numbers with 0. Positive numbers and zeros should remain unchanged. Print the modified array.
Example
Input:
5 10 -5 20 -8 30
Output:
10 0 20 0 30
DEMO-C-32 โข Programming in C
Write a C program to modify a 1D array by replacing all negative numbers with 0. Positive numbers and zeros should remain unchanged. Print the modified array.
Input:
5 10 -5 20 -8 30
Output:
10 0 20 0 30
n followed by n integers
Modified array
Submit runs every public testcase in this browser. Results and code never leave this device.
5 10 -5 20 -8 30
10 0 20 0 30
3 1 2 3
1 2 3
1 -100
0
C, C++, Java, and Python run locally in a browser VM. No worker or visualizer is used.
/workspace/question