This is the output I need. This is what I've got so far. I've only been able to figure out how to add 1 subject, but I need to add 2 more like the picture. I tried to save directly into the array but it didn't work. So i used strcpy.
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
typedef struct {
char subjectID[10];
char subjectName[10];
float marks;
}Subject;
typedef struct {
char Stu_ID[10];
char Stu_Name[30];
Subject subjects;
}Student;
int main()
{
Student a[3];
Student b;
int i;
strcpy(b.Stu_ID, "S100011");
strcpy(b.Stu_Name, "James");
strcpy(b.subjects.subjectID, "TOS10005");
strcpy(b.subjects.subjectName, "Programming");
b.subjects.marks=50;
printf("Student details \n");
printf("ID : %s\t Name : %s\n\n", b.Stu_ID, b.Stu_Name);
printf("Subject ID\t Name\t\t Marks\n");
printf("%s\t %s\t\t %.2f\t \n", b.subjects.subjectID, b.subjects.subjectName, b.subjects.marks);
}