Only use this if you have a forms compatible browser [Note: You must have an Internet connection in order to have these tests marked]
1. A structure called record which holds an integer called loop, a character array of 5 elements called word, and a float called sum, looks like
Structure 1
struct record { int loop; char word[5]; float sum; };
Structure 2
type structure record { loop : integer; word : array[0..4] of char; sum : real; };
Structure 3
type record { integer loop; char word[4]; float sum; }
2. The statement which declares a structure variable called sample, defined from a structure of type struct record, is
type sample : record; struct sample; struct record sample; declare sample as type record;
3. The statment that assigns the value 10 to the field loop of the sample structure (which is of type struct record), is
loop = 10; sample.loop = 10; record.sample.loop = 10; record.loop = 10;
4. The statement that prints out (using printf) the value of the word array of the sample structure is
printf("%d", sample); printf("%s", word ); printf("%c", sample-word ); printf("%s", sample.word );
5. The correct definition for a structure called birthdays, whose fields are a structure of type struct time called btime, and a structure of type struct date, called bdate, is
birthdays { time btime; date bdate; };
struct birthdays { struct time btime; struct date bdate; };
struct birthdays { struct bdate date; struct btime time; };
To submit your comments, press this button:
To clear the form, press this button:
©Copyright B Brown. 1984-1998. All rights reserved.