Question: C PROGRAMMING Question 1 Assume the following structure definition: struct inventory { char part_name[30]; int part_number; float price; }; Which of the following declares variable

C PROGRAMMING

Question 1

Assume the following structure definition:

struct inventory { char part_name[30]; int part_number; float price; };

Which of the following declares variable item to be of type struct inventory:

a.

struct inventory item;

b.

item = struct inventory;

c.

struct inventory = item;

d.

item struct inventory;

question 2

struct date { int month; int day; int year; };

Also assume the following variable declaration:

struct date birthdays[5] = {1, 10, 1995, 2, 3, 1996, 7, 21, 1987};

What is the value of birthdays[1].day?

question 3

struct date { int month; int day; int year; };

What does the following program output:

#include void display_birthday (struct date); main() { struct date birthdays[5] = {1, 10, 1995, 2, 3, 1996, 7, 21, 1987}; display_birthday ( birthdays[0] );

return 0; } /* end main */

void display_birthday (struct date d) { printf ("%d/%d/%d", d.month, d.day, d.year); } /* end display_birthday */

question 4

If I pass the address of a variable to a function, that variable is considered to be passed by ____________.

a.

reference

b.

value

question 5

Pointers can successfully be initialized to the following value: (Select all that apply)

a.

0 (the integer value zero)

b.

An address.

c.

Any value.

d.

Symbolic Constant: NULL

question 6

Assume the following array declaration: int test[3]; How many elements are in this array?

a.

1

b.

3

c.

2

d.

4

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!