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
cupoosta [38]
2 years ago
7

Q1) What would be the output of the program shown in the figure?

Computers and Technology
1 answer:
tensa zangetsu [6.8K]2 years ago
6 0

Answer:

23. Write a function named "g_c_d" that takes two positive integer arguments and returns as its value

the greatest common divisor of those two integers. If the function is passed an argument that is not

positive (i.e., greater than zero), then the function should return the value 0 as a sentinel value to

indicate that an error occurred. Thus, for example,

cout << g_c_d(40,50) << endl; // will print 10

cout << g_c_d(256,625) << endl; // will print 1

cout << g_c_d(42,6) << endl; // will print 6

cout << g_c_d(0,32) << endl; // will print 0 (even though 32

is the g.c.d.)

cout << g_c_d(10,-6) << endl; // will print 0 (even though 2 is

the g.c.d.)

24. A positive integer n is said to be prime (or, "a prime") if and only if n is greater than 1 and is

divisible only by 1 and n . For example, the integers 17 and 29 are prime, but 1 and 38 are not

prime. Write a function named "is_prime" that takes a positive integer argument and returns as its

value the integer 1 if the argument is prime and returns the integer 0 otherwise. Thus, for example,

cout << is_prime(19) << endl; // will print 1

cout << is_prime(1) << endl; // will print 0

cout << is_prime(51) << endl; // will print 0

cout << is_prime(-13) << endl; // will print 0

25. Write a function named "digit_name" that takes an integer argument in the range from 1 to 9 ,

inclusive, and prints the English name for that integer on the computer screen. No newline character

should be sent to the screen following the digit name. The function should not return a value. The

cursor should remain on the same line as the name that has been printed. If the argument is not in the

required range, then the function should print "digit error" without the quotation marks but followed by

the newline character. Thus, for example,

the statement digit_name(7); should print seven on the screen;

the statement digit_name(0); should print digit error on the screen and place

the cursor at the beginning of the next line.Explanation:

You might be interested in
The following memo does not follow the correct format. What should be changed? To: Stacy, Allen, and Emma Date: August 12, 2012
miss Akunina [59]
<span>The From: line should appear under the To: line.

</span>
4 0
3 years ago
Read 2 more answers
A web designer is creating a web site and wants each browser to resize the text size to look the same in each device. what measu
adelina 88 [10]
The designer could use the measurements in pixels. 
4 0
3 years ago
Create a static method called fillArray, which takes an integer array as an input parameter, along with an integer initial value
JulijaS [17]

Answer:

public class print{

   

   public static void fillArray(int[] arr, int initialValue){

       

       int n = arr.length;

      for(int i=0;i<n;i++){

          arr[i] = initialValue++;

      }

       for(int i=0;i<n;i++){

           System.out.print(arr[i]+" ");

      }

       

   }

    public static void main(String []args){

       

        int[] array = new int[5];

        int initialValue =3;

       

        fillArray(array,initialValue);

       

    }

}

Explanation:

Create the function with two parameter first is array and second is integer.

Then, declare the variable and store the size of array.

Take the for and fill the array from the incremented value of initialValue  by 1 at every run of loop.

After loop, print the element of the array.

Create the main function which is used for calling the function and also declare the array with size 5 and initialValue with 3. After that, call the function with this argument.

3 0
3 years ago
How do you measure the capacity of speed and memory of computer system<br>Explain.​
jeka94
Im sorry i just need points
3 0
3 years ago
Most software packages have functions for generating _____ about columns of data, which include statistical summaries like contr
GrogVix [38]

Answer:

Descriptives is the correct answer of this question.

Explanation:

Some software packages provide data column definitions that include qualitative summaries such as control averages, mean, average, minimum, standard deviation, number of zero values, number of empty records, etc.

  • A  descriptives summary is a sentence that gives someone information or something.
  • Description is the style of narration creation aimed at making a location, an event, a character or a community vivid.

There are 2 types of Descriptives :-

  1. Narrative type.
  2. Argumentative type.

3 0
3 years ago
Other questions:
  • Is this photo considered rim photography
    11·1 answer
  • Using the media as equipment for living. Explain how you would use some form of media to serve a purpose in your life—and what t
    6·2 answers
  • A JOB LEADS SOURCE LIST is used to help record all of the job leads you can find. It includes contact information and a plan for
    8·1 answer
  • Types of operating systems
    5·2 answers
  • Field names should NOT start with a(n) -<br> hyphen (-)<br> Oa<br> asterisk (*)<br> space()
    8·1 answer
  • a) Before writing any code, you should go through a design process. Try to do so carefully – either follow a top-down approach,
    15·1 answer
  • This is for career exploration, I need help please! &lt;3 HELPPPP
    8·2 answers
  • Sum of 18/7 and 13/7 is *​
    14·2 answers
  • ProgrammingAssignment3
    8·1 answer
  • Write a program that uses a while loop to calculate and print the multiples of 3 from 3 to 21. Your program should print each nu
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!