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
Can someone explain to me the process of inserting fonts into pdf, please? Also, related to this topic, metadata about a font th
andreyandreev [35.5K]

Answer:

what is inserting fonts into pdf:Font embedding is the inclusion of font files inside an electronic document. Font embedding is controversial because it allows licensed fonts to be freely distributed.

4 0
3 years ago
In the code snippet, what is the “win” part called in programming?
MAXImum [283]
I think the answer is B: parameter
8 0
3 years ago
What key do I use to start my presentation
Len [333]

Answer:

The answer to this question is given below in this explanation section.

Explanation:

Knowing how o start a presentation is crucial if you fail to capture the audience attention right of the bat your entire presentation will flop.Few listeners will stick with you to the end and retain what you have told.

That is mildly unpleasant when you are doing an in house presentation in front of your colleagues.But can become utterly embrassing when you are presenting in front of larger audience presentation to prospective customers.

Let you have most of your presentation slides and polished up you dont check and quick and effective power point presentation design tips.Many ideas are broken into bits sized statements for your slides and complemented with visuals.The best way is to appeal and invoke certain emotions with your audience curiosity,surprise fear or good old amusements.

8 0
3 years ago
What is the feature of ram for beginners
Wittaler [7]

RAM, or Random Access Memory, is physical hardware in a computer that actively stores information that is being used so that it can quickly be retrieved or accessed again soon. If you're running programs on you're computer, they will be using ram. If you plan on using a lot of programs, you will need more RAM.

7 0
3 years ago
Read 2 more answers
Write a method isSorted that returns true if the list is in sorted (nondecreasing) order and returns false otherwise. An empty l
kozerog [31]

Answer:

// This method is written in Java Programming Language

// Comments are used for explanatory purpose

// Method starts here

// Declare method isSorted

public boolean isSorted() {

// Create a listnode

ListNode lst = list;

// Check if list is null

if (list == null) {

return true;

}

// Iterate while list is not null

while (lst.next != null) {

// Get current list item

ListNode current = lst.next;

// Compare; if less than, return false

if (current.data < lst.data) {

return false;

}

// Assign current to lst

lst = current;

}

return true;

}

8 0
3 years ago
Other questions:
  • Input _____ is a template or pattern that restricts data entry and prevents errors.
    7·1 answer
  • By default, windows does not display ____________________ in windows explorer.
    8·1 answer
  • Being technologically literate requires being able to ______.
    11·2 answers
  • 7x+ 2x = 14<br>want is (x)?​
    15·1 answer
  • What are folders within folders called​
    8·2 answers
  • How did New York Governor Hugh Carey handle Sostre’s situation?
    9·2 answers
  • What can be used to help diagnose and fix network connection problems?
    8·1 answer
  • You have been given an encrypted copy of the Final exam study guide here, but how do you decrypt and read it???
    7·1 answer
  • How to resize an image in photoshop without losing quality.
    11·1 answer
  • 2
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!