Untitled

mail@pastecode.io avatar
unknown
plain_text
a month ago
666 B
1
Indexable
Never
#include<stdio.h>

struct college_details {
    char college_name[25];
    int college_id;
};

struct student_details{
    int id;
    char name[20];
    float percentage;
    struct college_details clg_data;
};

int main(){
    struct college_details clg = { "TIC", 771 };
    struct student_details stu_data ={1,"Shyam",90.5, clg};
    printf("ID is: \t\t %d\n",stu_data.id);
    printf("Name is: \t\t %s\n",stu_data.name);

    printf("Percentage is: \t %f\n",stu_data.percentage);

    printf("College ID is: \t%d\n",stu_data.clg_data.college_id);

    printf("College name is: \t%s\n",stu_data.clg_data.college_name);

    return 0;
}
Leave a Comment