Previous Next
0 / 20
Module DEMO-32-89DEMO-C-32

Cube Root

DEMO-C-32 โ€ข Programming in C

Browser-only practice

Problem Statement

Write a program that calculates the cube root of a number using pow(x, 1.0/3.0).

Target difficulty: Easy

Constraints

None

Input Format

A single floating-point number.

Output Format

The cube root formatted to 2 decimal places.

Sample Testcases

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

Sample #1
Public sample
8.0
2.00
pow(8.0, 1/3) = 2.00
Sample #2
Public sample
1.0
1.00
pow(1.0, 1/3) = 1.00
Sample #3
Public sample
1000.0
10.00
pow(1000.0, 1/3) = 10.00
Sample #4
Public sample
125.0
5.00
pow(125.0, 1/3) = 5.00

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