c program by using nested structure
#include<stdio.h>
#include<string.h>
struct student
_college_detail
{
int college_id;
char college_name[50];
};
struct student_detail
{
int id;
char name[20];
float percentage;
struct student_college_detail
clg_data;
}stu_data;
int main()
{
struct student_detail stu_data={1,”xxxx”,99.5,715,”abc university”);
printf(“Id
is:%d\n”,stu_data.id);
printf(‘Name
is:%d\n”,stu_data.name);
printf(“Percentage
is:%d\n”,stu_data.percentage);
printf(“College id
is:%d\n”,stu_data.college_id);
printf(“College name
is:%d\n”,stu_data.college_name);
return 0;
}
No comments:
Post a Comment