Description:
Use a struct to store student data.
Use a struct to store student data.
C Code
#include <stdio.h>
#include <string.h>
struct Student {
char name[50];
int roll;
float gpa;
};
int main() {
struct Student s;
strcpy(s.name, "Venkata Krishna");
s.roll = 101; s.gpa = 9.2;
printf("Name: %s\nRoll: %d\nGPA: %.1f\n", s.name, s.roll, s.gpa);
return 0;
}
Expected Output
Name: Venkata Krishna
Roll: 101
GPA: 9.2