menu
bartleby
search
close search
Hit Return to see all results

1. (3.12 in 8e) What does the following program print? Note: Don't just give me the output - tellme what mathematics quantity is being computed, what is "total" the total of, etc.#include int main void){unsigned int x = 1;unsigned int totalunsigned int ywhile x

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)
help_outline

Image Transcriptionclose

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)

fullscreen
check_circleAnswer
Step 1

1)

The given code snippet is used to print the squares of numbers from 1 to 10. It calculates the sum of squares of numbers from 1 to 10 and print it on the screen. So the squares of numbers will be 1, 4, 9, 16, 36, 49, 64, 81, 100. The sum of squares is 385.

Output
1
4
9
16
25
36
49
64
81
100
Total is
385
help_outline

Image Transcriptionclose

Output 1 4 9 16 25 36 49 64 81 100 Total is 385

fullscreen
Step 2

2) Output for the given statements:

Value of control variable "...

a)
6
10
12
b)
12
19
c)
3
6
9
12
15
CN
N LO
NLn
help_outline

Image Transcriptionclose

a) 6 10 12 b) 12 19 c) 3 6 9 12 15 CN N LO NLn

fullscreen

Want to see the full answer?

See Solution

Check out a sample Q&A here.

Want to see this answer and more?

Our solutions are written by experts, many with advanced degrees, and available 24/7

See Solution
Tagged in

Engineering

Computer Science

Programing Language

Related Computer Science Q&A

Find answers to questions asked by student like you

Show more Q&A add
question_answer

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

A: Major goals of Operating System are:VirtualizationConcurrencyPersistenceDistributionAbstraction

question_answer

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...

question_answer

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...

question_answer

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 ...

question_answer

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

question_answer

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,...

question_answer

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 ...

question_answer

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...

question_answer

Q: What is Android pie?

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

Sorry about that. What wasn’t helpful?