fork download
  1. #include<stdio.h>
  2. int main()
  3. {
  4. struct employee
  5. {
  6. float salary;
  7. char emp_name[20];
  8. int phone_no;
  9. }e1,e2;
  10. //printf("Enter the salary of first employee");
  11. scanf("%f",&e1.salary);
  12. //printf("Enter the name of first employee");
  13. scanf("%s",&e1.emp_name);
  14. //printf("Enter the phone no first employee");
  15. scanf("%d",&e1.phone_no);
  16. //printf("Enter the salary of second employee");
  17. scanf("%f",&e2.salary);
  18. //printf("Enter the name of second employee");
  19. scanf("%s",&e2.emp_name);
  20. //printf("Enter the phone no second employee");
  21. scanf("%d",&e2.phone_no);
  22. printf("The salary,name and phoneno of first employee is %f %s %d \n",e1.salary,e1.emp_name,e1.phone_no);
  23. printf("The salary,name and phoneno of second employee is %f %s %d",e2.salary,e2.emp_name,e2.phone_no);
  24. return 0;
  25. }
Success #stdin #stdout 0s 2296KB
stdin
13000
Bin
9813456789
18000
Rack
9812445678
stdout
The salary,name and phoneno of first employee is 13000.000000 Bin 2147483647 
The salary,name and phoneno of second employee is 18000.000000 Rack 2147483647