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
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?
|
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
