10. (B) Programs on unions.

10. (B) Programs on unions.
Programs on unions.

  1. #include <stdio.h>
  2. union Job
  3. {
  4. float salary;
  5. int workerNo;
  6. } j;
  7. int main()
  8. {
  9. j.salary = 12.3;
  10. j.workerNo = 100;
  11. printf("Salary = %.1f\n", j.salary);
  12. printf("Number of workers = %d", j.workerNo);
  13. return 0;
  14. }
10. (B) Programs on unions. 10. (B) Programs on unions. Reviewed by admin on December 23, 2019 Rating: 5

No comments:

Powered by Blogger.