Student Record

Easy Structures & Unions
Solve in Playground →

Problem Statement

Write a C program using a structure to store a student’s roll number, name, and marks, then print them.

Input Format

An integer roll number, a string name, and a float marks separated by spaces/newlines.

Output Format

Print student details in the format 'Roll: X, Name: Y, Marks: Z' (marks to 2 decimal places).

Constraints

1 <= Roll <= 1000, Name length <= 50, 0 <= Marks <= 100

Sample Input

101 John 85.5

Sample Output

Roll: 101, Name: John, Marks: 85.50

Explanation

Define a structure with roll, name, and marks members, read values, and display them.

Starter Code

#include <stdio.h>

struct Student {
    int roll;
    char name[51];
    float marks;
};

int main() {
    struct Student s;
    if (scanf("%d %50s %f", &s.roll, s.name, &s.marks) == 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