Employee Record

Easy Structures & Unions
Solve in Playground →

Problem Statement

Write a C program using a structure to store an employee ID, name, and salary, then print their details.

Input Format

An integer ID, a string name, and a double salary.

Output Format

Print employee details in the format 'ID: X, Name: Y, Salary: Z' (salary to 2 decimal places).

Constraints

1 <= ID <= 100000, Name length <= 50, 0.0 <= Salary <= 1000000.0

Sample Input

1001 Smith 55000.50

Sample Output

ID: 1001, Name: Smith, Salary: 55000.50

Explanation

Defines an Employee structure, reads fields, and prints formatted output.

Starter Code

#include <stdio.h>

struct Employee {
    int id;
    char name[51];
    double salary;
};

int main() {
    struct Employee e;
    if (scanf("%d %50s %lf", &e.id, e.name, &e.salary) == 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