Previous Next
0 / 18
Module DEMO-32-90DEMO-C-32

Square Calculator

DEMO-C-32 โ€ข Programming in C

Browser-only practice

Problem Statement

Write a function int square(int n) that returns the square of n.

Constraints

-100

Input Format

A single integer.

Output Format

The integer result.

Sample Testcases

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

Sample #1
Public sample
5
25
5 * 5 = 25.
Sample #2
Public sample
-4
16
-4 * -4 = 16.
Sample #3
Public sample
0
0
0 * 0 = 0.

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