home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Source Code 1992 March
/
Source_Code_CD-ROM_Walnut_Creek_March_1992.iso
/
msdos
/
turbo_c
/
trbocsrc.arc
/
STRUCT1.C
< prev
next >
Wrap
C/C++ Source or Header
|
1988-02-01
|
645b
|
25 lines
/* Chapter 11 - Program 1 */
main()
{
struct {
char initial; /* last name initial */
int age; /* childs age */
int grade; /* childs grade in school */
} boy,girl;
boy.initial = 'R';
boy.age = 15;
boy.grade = 75;
girl.age = boy.age - 1; /* she is one year younger */
girl.grade = 82;
girl.initial = 'H';
printf("%c is %d years old and got a grade of %d\n",
girl.initial, girl.age, girl.grade);
printf("%c is %d years old and got a grade of %d\n",
boy.initial, boy.age, boy.grade);
}