Computers and Technology

Answer the following true/false questions using the code that follows. You must correctly state WHY your answer is true or false in order to receive credit.
# include
# include
# include
#define SIZE 4
typedef struct dessert{
char size;
float price;
charflavor[20]:
int available;
}dessert;
void give info(dessert *des, int size, char filename)
{
FILE *fp=fopen(filename,"r");
char *token;
char line[40];
int i
for(i 0:i {
fgets(line, 40, fp);
token-strtok(line,"":
des[i].size=token[0];
token strtok(NULL,".");
des[i. price-atof token);
token strtok(NULL,",");
strcpy(des[i].flavor, token):
token strtok(NULL,"n)
desi available-atoi(token);
}
fclose(fp):
}
void print report(dessert "d, int size)
{
int i
printf(nCURRENT INVENTORY: n");
for(i 0 i {
printf(" Info for Item %d \n", (i+ 1));
printf("Size: %<\n", (*d)size);
printf(" Price: 962f\n", ("d).price);
printf(" Flavor: %s\n", (*d) flavor);
printf("Ava ili blity: %d\n\n", ("d).available);
d ++:
}
}
int main (int argc, char "argv)
{
int num-atoi(argv1);
dessert "des (dessert)malloc(sizeof dessert) num):
if(des-=NULL)
{
printf ("Error getting you some memory! Bye. In");
}
else
{
give jinfo(des, num, argv[21):
print report(des, num):
}
free(des):
}
True / False:
1) The function printf is defined in this program.
2) stdio. h is the function that allows us to output to screen.
3) This code includes one header and two preprocessor directives.
4) argc is a function.

answer
Answers: 3

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 16:30, buky0910p6db44
Corey set up his presentation for delivery to his team. the information he had to convey was critical to their job performance. he knew he would need a lot of time to explain each point
Answers: 3
image
Computers and Technology, 22.06.2019 22:00, bbysl15
What is the name of the option in most presentation applications with which you can modify slide elements? 1. the option enables you to modify a slide element in most presentation applications.
Answers: 3
image
Computers and Technology, 23.06.2019 06:30, eddsworldfrantic
You have a small company and want to keep your costs low, but it is important your employees share data. which network would provide you with the most economical solution?
Answers: 1
image
Computers and Technology, 23.06.2019 17:00, evanwall91
What does the faves button do? a. users mark a web page as a favorite b. leads other readers to favor a specific page c. readers sort and align their favicons, or favorite icons d. leads users to a message board where they can post questions
Answers: 1
Do you know the correct answer?
Answer the following true/false questions using the code that follows. You must correctly state WHY...

Questions in other subjects:

Konu
Chemistry, 06.11.2020 05:30