fork download
  1. #include<stdio.h>
  2. struct student{
  3. char fname[20];
  4. int yr_lvl;
  5. };
  6.  
  7. int main(){
  8. struct student stdn;
  9.  
  10. printf("Enter name: ");
  11. gets(stdn.fname);
  12.  
  13. printf("Enter Year and Level: ");
  14. scanf("%i",&stdn.yr_lvl);
  15.  
  16. printf("Name: %s", stdn.fname);
  17. printf("\nYear and Level: %i",stdn.yr_lvl);
  18. }
  19.  
Success #stdin #stdout 0s 5300KB
stdin
Standard input is empty
stdout
Enter name: Enter Year and Level: Name:  �⫚U
Year and Level: 32767