Inventory Record

Medium Structures & Unions
Solve in Playground →

Problem Statement

Write a C program using a structure to store item code, quantity, and unit price, then compute and print total inventory value.

Input Format

Item code (int), quantity (int), and unit price (float).

Output Format

Print total inventory value formatted to 2 decimal places.

Constraints

1 <= Code <= 10000, 1 <= Qty <= 1000, 0.0 <= Price <= 10000.0

Sample Input

101 50 45.50

Sample Output

2275.00

Explanation

Total value = Quantity * Unit Price = 50 * 45.50 = 2275.00.

Starter Code

#include <stdio.h>

struct Item {
    int code;
    int qty;
    float price;
};

int main() {
    struct Item item;
    if (scanf("%d %d %f", &item.code, &item.qty, &item.price) == 3) {
        // Write your code here
    }
    return 0;
}

Limits

  • Time Limit: 1s
  • Memory Limit: 256MB

Embedded C Programming

Updated: March 15, 2026
Intermediate

Embedded systems rely on efficient low-level programming to interact directly with hardware. In this course, you will learn how to write practical Embedded C programs used in real microcontroller-based systems. Rather than focusing only on theory, this course follows a practice-driven approach. Each lesson includes hands-on coding exercises that simulate real firmware development tasks used