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
In what year was google launched on the web?
nadya68 [22]
Google was first launched in the year 1998 (yeah, not all that old) on September 4th.
3 0
3 years ago
True or False<br><br> The signing of Act 26 made Cyber Harassment of a Child a crime.
Levart [38]
True, online bullying is a crime and can be fined or arrested for it.
3 0
3 years ago
A descriptive study represents the highest level on the knowledge-level continuum.
Aleksandr-060686 [28]

Answer:

Option b:  False

Explanation:

Descriptive studies are actually the observational studies describing the occurrence patterns to different diseases relative to various variables including person, place or time.

It includes the collection of quantitative information in tabulated form along a numerical continuum.

8 0
3 years ago
If String str = "Computer Science";, then what is the value of str.substring(10);? ​
Genrish500 [490]

Answer:

cience

Explanation:

From the question, the string variable str was initialized to "Computer Science:

str.substring(10) implies that we get a substring starting from the character at the 10th index till the last index

In this case, the 10th index character is c

So, the instruction will return cience

3 0
3 years ago
Question # 1 Multiple Select Which of the following shows the assignment of a string to a variable? Select 3 options. answer = "
bazaltina [42]

Answer:

answer = input("How old are you?")

Explanation:

Answer is a variable The Input function takes a string

6 0
2 years ago
Read 2 more answers
Other questions:
  • 1.
    5·2 answers
  • Which of the following is an example of a direct payment subsidy?
    12·1 answer
  • Your laptop doesn't have a serial port. what type of connector will your laptop require
    6·1 answer
  • All of the following are recommended to secure a wireless network EXCEPT:
    5·2 answers
  • The algorithm ADDN implements N-bit fixed-width binary addition for non-negative integers and ignores overflows. For example, AD
    13·1 answer
  • what is the total resistance of a series circuit with four resistors in series of 12 16 20 and 24 ohms​
    14·1 answer
  • To complete this quest, answer the following questions in the submission box below. Make x an array going from 0 to 100 by steps
    15·1 answer
  • A device that make it possible for a muitiple customer to share one address is called
    13·1 answer
  • Expectation on Information Technology Fundamental​
    12·1 answer
  • Criminal investigations are limited to finding data defined in the search ____.
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!