fork download
  1. #include<stdio.h>
  2. struct employee{
  3. char name[30];
  4. int empId;
  5. float salary;
  6. }emp;
  7. int main()
  8. {
  9. struct employee;
  10. printf("\nEnter details\n");
  11. printf("Name ");
  12. scanf("%[^n]s",emp.name);
  13. printf("empid ");
  14. scanf("%d",&emp.empId);
  15. printf("Salary ");
  16. scanf("%f",&emp.salary);
  17. printf("\nEntered detail is:");
  18. printf("Name: %s",emp.name);
  19. printf("empid: %d" ,emp.empId);
  20. printf("Salary: %f\n",emp.salary);
  21. return 0;
  22. }
  23.  
Success #stdin #stdout 0s 5432KB
stdin
45
stdout
Enter details
Name empid Salary 
Entered detail is:Name: 45empid: 0Salary: 0.000000