Skip to Main Content
Xpress Learning - Computer Fundamentals of Programming an IT by Pearson
book

Xpress Learning - Computer Fundamentals of Programming an IT by Pearson

by Ashok N. Kamthane, Rohit Khurana
May 2024
Beginner to intermediate content levelBeginner to intermediate
465 pages
16h 14m
English
Pearson India
Content preview from Xpress Learning - Computer Fundamentals of Programming an IT by Pearson
II-294 Programming Concepts
Program on Union
16. Sizes of union and structure
void main()
{
union result
{
int marks;
char grade;
};
struct res
{
char name[15];
int age;
union result perf;
} data;
clrscr();
printf("Size of union : %d\n",sizeof(data.perf));
printf("Size of Structure : %d\n", sizeof(data));
}
OUTPUT:
Size of union : 2
Size of Structure : 19
Programs on Calling Bios and Dos Services
17. Use of REGS
#include <stdio.h>
#include <conio.h>
#include <dos.h>
void main()
{
union REGS in,out;
in.h.ah=02;
in.h.dl=89;
clrscr();
intdos(&in,&out);
}
OUTPUT:
Y
M13_ITL-ESL4791_02_SE_C13.indd 294 12/22/2012 5:06:17 PM
Structure and Union II-295
Find the bug/s in the following ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Express Learning - Computer Fundamentals and Programming

Express Learning - Computer Fundamentals and Programming

Ashok Kamthane, ITL ESL
Windows® Internals, Sixth Edition, Part 2

Windows® Internals, Sixth Edition, Part 2

David A. Solomon Mark E. Russinovich and Alex Ionescu

Publisher Resources

ISBN: 9781299954878