Computers and Technology

What is the output of the following program, where the zu format specifier in the printf statement below displays the result of sizeof as a decimal integer?

#include
#include

typedef union {
double d;
char c[20];
}u;

int main() {
u temp;
temp. d = 11.5;
strcpy(temp. c, "cs 354");
printf("%zu, %f, %s\n",sizeof(temp), temp. d, temp. c);
return 0;
}
20, garbage value, cs 354
20, 11.5, cs 354
28, 11.5, cs 354
28, garbage value, cs 354
runtime error

answer
Answers: 3

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 22:00, suewignall
During physical science class ben and jerry connected three identical lightbulbs in parallel to a battery where happens when ben removes one of the lightbulbs from it’s socket
Answers: 2
image
Computers and Technology, 23.06.2019 03:10, nxusasmangaliso8780
Fill in the following program so that it will correctly calculate the price of the orange juice the user is buying based on the buy one get one sale.#include //main functionint main() { int cartons; float price, total; //prompt user for input information printf("what is the cost of one container of oj in dollars? \n"); scanf(" [ select ] ["%d", "%c", "%f", "%lf"] ", & price); printf("how many containers are you buying? \n"); scanf(" [ select ] ["%d", "%c", "%f", "%lf"] ", & cartons); if ( [ select ] ["cartons / 2", "cartons % 1", "cartons % 2", "cartons % price", "cartons / price", "cartons / total"] [ select ] ["=", "==", "! =", "< =", "> =", "< "] 0) total = [ select ] ["price * cartons", "cartons * price / 2 + price", "(cartons / 2) * price", "cartons / (2.0 * price)", "(cartons / 2.0) * price + price", "((cartons / 2) * price) + price"] ; else total = ((cartons / 2) * price) + price; printf("the total cost is $%.2f.\n", total); return 0; }
Answers: 2
image
Computers and Technology, 23.06.2019 13:10, BrianKeokot4534
What is domain name system (dns)? allows dynamic ip address allocation so users do not have to have a preconfigured ip address to use the network converts ip addresses into domains, or identifying labels that use a variety of recognizable naming conventions the efficient coexistence of telephone, video, and data communication within a single network, offering convenience and flexibility not possible with separate infrastructures the integration of communication channels into a single service
Answers: 2
image
Computers and Technology, 23.06.2019 15:30, Dweath50
The processing of data in a computer involves the interplay between its various hardware components.
Answers: 1
Do you know the correct answer?
What is the output of the following program, where the zu format specifier in the printf statement b...

Questions in other subjects:

Konu
Mathematics, 19.09.2019 02:20
Konu
Mathematics, 19.09.2019 02:20