Question
Question 4 1 The DATE structure has three fields, all integers: month day year A STU structure has two fields: name, a string and date
Question 4 1
The DATE structure has three fields, all integers: month day year A STU structure has two fields: name, a string and date of type DATE. STU sam; STU *ptr = &sam; How do you assign 2 to month in sam using ptr? Group of answer choices
A(*ptr).date->month = 2;
B ptr->date.month = 2;
C ptr->month = 2;
D *ptr.date.month = 2;
Question 6
Partial initialization of structures is similar to partial initialization of arrays: uninitialized elements are
A set to 0.
B have unknown values.
C set to a default standard value.
D It is not possible to partially initialize a structure.
Q7 What is missing from the following statements?
double length;
scanf(%lf, &length);
A Replace "%lf" with "%f"
B Double quotes around %lf: "%lf"
C Nothing
D Double quotes in scanf: scanf("%lf, &length");
Q.8 Given the code fragment below:
double *test(double, int *); // declaration
int quantity = 22;
double unit_price = 3.99;
double *p = &unit_price;
double *q;
Which one of the following calls matches the function
A q = test(*p, quantity);
B q = test(&p, &quantity);
C q = test(p, &quantity);
D q = test(*p, &quantity);
Q9 Assume that your computer has one-byte chars and eight-byte pointers.
char s[16] = "Bytes";
char *ptr = s;
What is the value of the following expression?
sizeof(*ptr)
A 5
B 1
C 16
D 8
Q 10 How many bytes do you have to allocate to store strings such as "SFO" or "LAX"?
A 3
B 5
C 4
D 6
Q.11 What marks the end of a C-string?
A NULL
B '\t'
C '\0'
D '0'
E' '
Question 4 1
The DATE structure has three fields, all integers: month day year A STU structure has two fields: name, a string and date of type DATE. STU sam; STU *ptr = &sam; How do you assign 2 to month in sam using ptr? Group of answer choices
A(*ptr).date->month = 2;
B ptr->date.month = 2;
C ptr->month = 2;
D *ptr.date.month = 2;
Question 6
Partial initialization of structures is similar to partial initialization of arrays: uninitialized elements are
A set to 0.
B have unknown values.
C set to a default standard value.
D It is not possible to partially initialize a structure.
Q7 What is missing from the following statements?
double length;
scanf(%lf, &length);
A Replace "%lf" with "%f"
B Double quotes around %lf: "%lf"
C Nothing
D Double quotes in scanf: scanf("%lf, &length");
Q.8 Given the code fragment below:
double *test(double, int *); // declaration
int quantity = 22;
double unit_price = 3.99;
double *p = &unit_price;
double *q;
Which one of the following calls matches the function
A q = test(*p, quantity);
B q = test(&p, &quantity);
C q = test(p, &quantity);
D q = test(*p, &quantity);
Q9 Assume that your computer has one-byte chars and eight-byte pointers.
char s[16] = "Bytes";
char *ptr = s;
What is the value of the following expression?
sizeof(*ptr)
A 5
B 1
C 16
D 8
Q 10 How many bytes do you have to allocate to store strings such as "SFO" or "LAX"?
A 3
B 5
C 4
D 6
Q.11 What marks the end of a C-string?
A NULL
B '\t'
C '\0'
D '0'
E' '
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started