Write a C program using a structure to store a student’s roll number, name, and marks, then print them.
An integer roll number, a string name, and a float marks separated by spaces/newlines.
Print student details in the format 'Roll: X, Name: Y, Marks: Z' (marks to 2 decimal places).
1 <= Roll <= 1000, Name length <= 50, 0 <= Marks <= 100
101 John 85.5
Roll: 101, Name: John, Marks: 85.50
Define a structure with roll, name, and marks members, read values, and display them.
#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;
}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