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
mash [69]
4 years ago
13

Assume there is a variable , h already associated with a positive integer value. Write the code necessary to count the number of

perfect squares whose value is less than h , starting with 1 . (A perfect square is an integer like 9 , 16 , 25 , 36 that is equal to the square of another integer (in this case 3*3 , 4*4 , 5*5 , 6*6 respectively).) Assign the sum you compute to a variable q For example, if h is 19 , you would assign 4 to q because there are perfect squares (starting with 1 ) that are less than h are: 1 , 4 , 9 , 16 .
_____________________________________________________________________________
Computers and Technology
1 answer:
Nataly_w [17]4 years ago
4 0

Answer:

pseudo code:

x=1

q=0

while x*x<h: {

x += 1}

q=x-1

complete code in C language

#include <stdio.h>

int main() {    

   int h=19;

  int q=0;

   int x=1;

  while ((x*x)<h){

 x += 1;

   }

   q=(x-1);

   printf("The sum of total perfect squares less than %d is: %d", h,q);

   

   return 0;

}

Explanation:

first '%d' in print statement refers to h and second '%d' in print statement refers to q

You might be interested in
What kind of company would hire an Information Support and Service employee?
Murrr4er [49]

Answer:

B. Computer Repair

Explanation:

I got it right on edge. trust.

7 0
3 years ago
Read 2 more answers
Which section is optional in a resume?
suter [353]

<em>Career Objectives </em>are pointless in a resume, Things like experience, Contact details, education and skills, help the company decide whether to take you or not, in accordance with their needs. They don't need to know why you want the job as opposed to how you could help them.

7 0
3 years ago
What is the term for the process of swapping items between memory and storage?
Naddik [55]
Swapping pages of memory from core memory and disk is called swapping in Unix, and paging in Microsoft.
3 0
3 years ago
Read 2 more answers
Ryan is looking to buy a new HDTV set. He knows from friends that LCD set screens reflect less light than plasma set screens, bu
lbvjy [14]

Answer: Cognitive

Explanation:

 According to the question, the Ryan shows cognitive attitude towards the HDTV. The cognitive component basically refers to the three main components that are:

  • Thoughts
  • Beliefs
  • Attributes

The cognitive component is one of the type of attitude which basically consist of various types of thoughts, knowledge and the beliefs towards the any type of object. It is one of the belief and opinion of the attitude.  

3 0
3 years ago
The first page of a website is what?​
EleoNora [17]

Answer:

index.html

Explanation:

The name of the html file for the homepage of a website is usually "index.html"

4 0
3 years ago
Read 2 more answers
Other questions:
  • How many bits are in 1 tb? [hint: depending on the tool used to calculate this, you may need to use a trick to get the exact res
    6·1 answer
  • There was a software crisis in 1968, as result of programming abilities, due to the invention of integrated circuits (chips).A.
    10·1 answer
  • Invalid length parameter passed to the LEFT or SUBSTRING function (below)".
    6·1 answer
  • Explain how inflation flattens the universe
    6·2 answers
  • Which is the MOST efficient means of disentangling passengers from a wrecked​ vehicle? A. Remove the steering wheel and column.
    10·1 answer
  • I NEED HELP PLEASE ITS TIMED
    9·1 answer
  • If you wish to collect data from two related websites with different domains in a single google analytics property, what feature
    8·1 answer
  • You insert a comment in a worksheet by using a command on the ____ tab on the Ribbon.
    13·1 answer
  • A ________ is an input device that responds to finger touch.
    8·2 answers
  • The choice of database does not have any impact on the relevancy of search results?
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!