Post Page Advertisement [Top]

C-Programming

Write a program in c demonstrate example in nested structure??

Write a program in c demonstrate example in nested structure??
Write a program in c demonstrate example in nested structure??

/* demonstrate example in nested structure */
#include<stdio.h>
#include<conio.h>
struct student
{char name[30];
int roll no;
struct {int dd;
int mm;
int yy;
}dob;
};
main()
{struct student std;
clrscr();
printf("enter name:-");
gets(std.name);
printf("enter roll no:-");
scanf("%d",&std.rollno);
printf("enter dob(dd/mm/yy),format:-");
scanf("%d %d %d",&std.dob.dd,&std.dob.mm,&std.dob.yy);
printf("\nname:%s \nrollno: %d\ndob %2d %2d %2d",std.name,std.rollno,std.dob.dd,std.dob.mm,std.dob.yy);
}


DizIT_Operators
Thank-You 

No comments:

Post a Comment

Bottom Ad [Post Page]