1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
erastovalidia [21]
3 years ago
7

ven int variables k and total that have already been declared, use a while loop to compute the sum of the squares of the first 5

0 positive integers and store this value in total. Thus your code should put 1*1 2*2 3*3 ... 49*49 50*50 into total. Use no variables other than k and total.
Computers and Technology
1 answer:
monitta3 years ago
3 0

Answer:

Following are statement is given below

int  k=1,total=0; // variable declaration

while(k<50) // iterating the while loop

{

   total=total+k*k;//  calculating the square

   k=k+1; // increments the value of k by 1    

}

Explanation:

Following are the description of Statement.

  • Declared a variable "total" and "k" of the "integer " type initialized the total to 0 and "k" to 1.
  • Iterating the while loop for less then 50 .In this loop, we calculating the sum of square of first 50 number in the "total" variable .
  • After that increment the value of "k" variable by 1 to execute the loop less then 50 .

You might be interested in
Which of the following statement about CAD is NOT true A. It increase the productivity of designers B. It uses computer graphics
Sedaia [141]

Answer:

D. All are true.

Explanation:

All the given statements about CAD are true.

5 0
3 years ago
_____ lets you look at two documents at the same time.
jasenka [17]
B. Side by side view
6 0
2 years ago
Which of the following statements is TRUE? A. A name error occurs if the variable is referenced before it is declared. B. A name
lisov135 [29]

Answer:

A is the correct answer.

8 0
2 years ago
What is the first step in the exchange between a web browser and a database?
bezimeni [28]
<span>The client browser requests a page from a Web server.</span>
3 0
3 years ago
The process of learning by making mistakes and by trial and error is called _____.
vodomira [7]
I believe it’s problem solving.
6 0
2 years ago
Other questions:
  • Social networking sites like Office Online, PayPal, and Dropbox are used to develop social and business contacts.
    6·2 answers
  • Which Internet resource can you use to publicly describe an adventure trip you recently made?
    9·1 answer
  • When you include a word cover page in a multi page document, the cover page is not considered the first page. True or false?
    13·1 answer
  • Which osi reference model layer includes all programs on a computer that interact with the network?
    13·1 answer
  • What will the following program display?
    15·1 answer
  • How many generations of computer languages have there been since the middle of the 20th century?
    10·1 answer
  • State the difference between = and ==
    9·1 answer
  • Why is information broken down into packets
    15·1 answer
  • You are going to create an Arduino sketch where you have two push buttons, one piezo, one
    10·1 answer
  • Challenge activity 1.11.1: using constant in expression is not working for me. Can any one help me find the right code?
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!