CJCoding With Joseph

Total Cost of an Order

An array of three struct Item values each has a price and a qty. The items are {5, 2}, {3, 4}, and {10, 1}. Compute the order total by summing price * qty over all items and print it:

32

That is 5*2 + 3*4 + 10*1 = 10 + 12 + 10 = 32. There is no trailing newline.

Expected Output:

32
Topics:
Structs
Code Editor
1
Tab to indent ยท Ctrl+Enter to run ยท Ctrl+Space to expand shortcuts (p, fori)

Your Output

Run your code to see the output here...

Test Cases

Run your code to see test case results.