Question
1. (3.12 in 8e) What does the following program print? Note: Don't just give me the output - tell
me what mathematics quantity is being computed, what is "total" the total of, etc.
#include <stdio.h>
int main void)
{
unsigned int x = 1;
unsigned int total
unsigned int y
while x <= 10 ) [
у3х
printf "%d\n", y );
total y
х;
++x
//end while
printf( "Total is %d\n", total );
} //end main
2. (4.6 in 8e) State which values of the control variable x are printed by each of the following for
statements:
a)
for (x 2; x <= 13; x +=
2)
printf("%u\n", x);
}
for (x 5; x <= 22; x += 7) {
b)
printf("%u\n", x);
}
c)
for (x 3; x <= 15; x += 3) {
printf("%u\n", x);
}
d)
for (x 1; x <= 5; x += 7)
printf("%u\n", x);
}
12; x 2; x
printf("%u\n", x);
}
e) for (x
3)

Image Transcription

1. (3.12 in 8e) What does the following program print? Note: Don't just give me the output - tell me what mathematics quantity is being computed, what is "total" the total of, etc. #include <stdio.h> int main void) { unsigned int x = 1; unsigned int total unsigned int y while x <= 10 ) [ у3х printf "%d\n", y ); total y х; ++x //end while printf( "Total is %d\n", total ); } //end main 2. (4.6 in 8e) State which values of the control variable x are printed by each of the following for statements: a) for (x 2; x <= 13; x += 2) printf("%u\n", x); } for (x 5; x <= 22; x += 7) { b) printf("%u\n", x); } c) for (x 3; x <= 15; x += 3) { printf("%u\n", x); } d) for (x 1; x <= 5; x += 7) printf("%u\n", x); } 12; x 2; x printf("%u\n", x); } e) for (x 3)

Expert Answer

1 Rating

Want to see the step-by-step answer?

See Answer

Check out a sample Q&A here.

Want to see this answer and more?

Step-by-step answers are written by subject experts who are available 24/7. Questions are typically answered in as fast as 30 minutes.*

See Answer
*Response times vary by subject and question complexity. Median response time is 34 minutes and may be longer for new subjects.
Tagged in
EngineeringComputer Science

Programing Language

Related Computer Science Q&A

Find answers to questions asked by student like you
Show more Q&A

Q: In addition to virtualization, concurrency and persistence, name two more major goals of operating s...

A: Major goals of Operating System are:VirtualizationConcurrencyPersistenceDistributionAbstraction

Q: please help me solve this problem in C++

A: Program AlgorithmDeclare the required variables and an array.Then write a for loop to generate three...

Q: Consider the following nested loop construct. Categorize its efficiency in terms of the variable n u...

A: Categorization of efficiency in terms of “n” using “big-o” notation:The statement “x*=2” is given in...

Q: Create a new file in c++.  In this lab, you will add some functionality to the table ofmenu. Your bo...

A: Program Instructions:Declare variables and write a welcome message.Always convert the user's choice ...

Q: In Example 6.1, show a derivation tree for the string ababbac, using both the original and the modif...

A: Given:Grammar 1: A→a|aaA|abBc,B→abbA|bModified grammar: A→a|aaA|ababbAc|abbc,B→abbA|bString: ababbac

Q: In PL/SQL, Create a recursive store function called add_numbers to calculate the total of all consec...

A: Program plan:Declare the required variables.The “add_numbers” function returns the value. Otherwise,...

Q: What is the ASCII decimal value for a lower case 'a'?

A: Definition ASCII stands for the American Standard Code for Information Interchange. Basically, this ...

Q: For this program you need to use Eclipse

A: Program plan:Declare the integer variables “coin” and “guess” and string variable “num”.Generate the...

Q: What is Android pie?

A: Android is basically an operating system developed by Google for smartphones just like Windows is an...