Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Multiple Choice Question 1 part a) For the program instruction float data[33] = {1,2,3,4,5,6,7}; what value does the data[7] have? *0 *6 *7 *8 part

Multiple Choice Question 1

part a) For the program instruction float data[33] = {1,2,3,4,5,6,7}; what value does the data[7] have?

*0

*6

*7

*8

part b) For program instruction:

void add()

void sub()

int glob = 10;

int main()

{

add();

printf("Val = %d , glob);

sub();

printf("Val = %d , glob);

return 0;

}

void add()

{

glob++;

}

void sub()

{

glob--;

}

What is the output?*val=10, val=9

*val=10, val=10

*val=11, val=10

*no output

part c) For the program instructions:

float expenses[12]= {1,2,3,4,5,6,7,8,9,10,11,12};

int year_expenses;

int count;

for (count = 1; count < 12; count++) {

printf("Month %d = $%.2f ", count, expenses[count]);

year_expenses += expenses[count];

}

printf("$ %d",year_expenses);

What is the final line of output?

*You will get a runtime error due to no array[13]

*You will get a runtime error due to no array[12]

*Yearly expenses are $78.00

*Yearly expenses are $77.00

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Databases A Beginners Guide

Authors: Andy Oppel

1st Edition

007160846X, 978-0071608466

More Books

Students also viewed these Databases questions

Question

What are the classifications of Bank?

Answered: 1 week ago

Question

=+j Describe the various support services delivered by IHR.

Answered: 1 week ago