Previous Next
0 / 8
Module DEMO-32-55DEMO-C-32

Grocery Store Calculator three items

DEMO-C-32 โ€ข Programming in C

Browser-only practice

Problem Statement

You are working as a cashier at a grocery store. A customer has purchased exactly three items. Your task is to calculate the total cost of these items and print the result.

The customer has provided you with the price of each item separately. You need to read these three prices and compute their sum.

This is a simple calculation that cashiers perform daily - adding up the prices of purchased items to determine the total amount the customer needs to pay.

Constraints

Each item price will be between 0.01 and 1000.00 dollars All prices are given as positive floating-point numbers with up to two decimal places

Input Format

Three floating-point numbers on a single line, separated by spaces, representing the prices of the three items in dollars.

Output Format

A single floating-point number representing the total cost of all three items, printed with exactly two decimal places.

Sample Testcases

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

Sample #1
Public sample
10.50 7.25 3.99
21.74
The sum of 10.50 + 7.25 + 3.99 = 21.74

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