fork download
  1. #include <stdio.h>
  2. #include<string.h>
  3. struct student
  4. {
  5. char name[100];
  6. struct dob
  7. {
  8. int date;
  9. int month;
  10. int year;
  11. }birth;
  12. int submarks[4];
  13. }stu1, stu2;
  14. int main()
  15. {
  16. printf("Enter name");
  17. scanf("%s",&stu1.name);
  18. printf("Enter DOB");
  19. scanf("%d",&stu1.birth.date);
  20. scanf("%d",&stu1.birth.month);
  21. scanf("%d",&stu1.birth.year);
  22. for(int i=0;i<4;i++)
  23. scanf("%d",&stu1.submarks[i]);
  24. printf("Name is %s",stu1.name);
  25. printf("DOB is %d/%d/%d",stu1.birth.date,stu1.birth.month,stu1.birth.year);
  26. for(int i=0;i<4;i++)
  27. printf("sub %d marks is ",stu1.submarks[i]);
  28.  
  29. }
  30.  
Success #stdin #stdout 0.02s 4780KB
stdin
Aditya
5
1
2002
98
97
96
95
stdout
Enter nameEnter DOBName is AdityaDOB is 5/1/2002sub 98 marks is sub 97 marks is sub 96 marks is sub 95 marks is