โ Back to Structs
Question 346
Total Cost of an Order
Total Cost of an Order
An array of threestruct Itemvalues each has apriceand aqty. The items are{5, 2},{3, 4}, and{10, 1}. Compute the order total by summingprice * qtyover all items and print it: 32 That is5*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.