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]
3 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]3 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
Which of these is an advantage of having multiple layers in a drawing and enables you to make changes to one part of an image wi
Ivan

Answer:

enables you to make changes to one part of an image without accidentally changing other parts

Explanation:

Computer aided designs incorporate the use of multiple layers in drawings. The first layer is known as the layer 0, while the present layer the designer is working on is known as the current layer. The advantage of the incorporation of layers in designs include the following

1. It helps objects to be altered, grouped, hidden and moved as the designer wishes.

2. Layers can be grouped and worked on separated and common properties like color and line weight assigned to them.

3. Layers can be manipulated as the user wishes. They can be locked, frozen, turned off, etc.  Locking prevents accidental changes being made on objects.

4 0
2 years ago
Introduction or background of corporal punishment in schools
tensa zangetsu [6.8K]

Answer:

Corporal punishment is a discipline method in which a supervising adult, such as a teacher, deliberately inflicts pain upon a child in response to a child's unacceptable behavior or inappropriate language. The goals of this type of punishment are usually to halt the offense immediately, prevent it from happening again, and set an example for others.

3 0
3 years ago
PLEASE HELP ASAP!!
inn [45]
The answer is encryption

steganography would be hiding data, like in an image
digital forensics is the analysis done after an attack
and the last one is a security standard
6 0
2 years ago
Question 12
AlladinOne [14]

Which is a multicast address ?

ans: 241.2.2.1

6 0
2 years ago
Which command should you use to display both listening and non-listening sockets on your linux system? (tip: enter the command a
trasher [3.6K]

Answer: netstat -a

Explanation: The netstat -a command displays both listening and non-listening sockets.

3 0
2 years ago
Other questions:
  • Jeremy’s office is in an earthquake prone area. His web server is in his office. What step should he take to protect the data on
    5·1 answer
  • What can be entered in a search box to find data? data size a name relevance purpose
    5·2 answers
  • ________ programming is a method of writing software that centers on the actions that take place in a program.
    8·1 answer
  • Saving a file as a new filename can be accomplished through the Save As dialog box.
    13·1 answer
  • Assembly (Procedure and Conditional Processing). For the following program, what are outputs for register EAX, EBX, ECX, and EDX
    11·1 answer
  • What is the multiple source test
    15·1 answer
  • A communication medium that carries a large amount of data at a fast speed is called
    6·1 answer
  • Write the code to replace only the first two occurrences of the word second by a new word in a sentence. Your code should not ex
    15·1 answer
  • What can I do If my Texas Instrument TI-84 calculator is not giving accurate answers?
    6·1 answer
  • Which of the following terms refers to the cells that contain values and labels to be graphed in the chart?.
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!