السابق التالي
0 / 18
الوحدة النمطية DEMO-32-90DEMO-C-32

Sign Checker

DEMO-C-32 • Programming in C

Browser-only practice

بيان المشكلة

Write a function void checkSign(int n) that determines if a number is positive, negative, or zero.

If n is greater than 0, print "Positive".

If n is less than 0, print "Negative".

If n is 0, print "Zero".

Output should be followed by a newline.

قيود

Integer values within standard range.

تنسيق الإدخال

A single integer.

تنسيق الإخراج

One of the strings: "Positive", "Negative", or "Zero".

حالات اختبار نموذجية

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

العينة رقم 1
عينة ظاهرة
10
Positive
10 is greater than 0.
العينة رقم 2
عينة ظاهرة
-5
Negative
-5 is less than 0.
العينة رقم 3
عينة ظاهرة
0
Zero
The number is 0.

Web terminal

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

Saved in this browser
إعدادات المحرر