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
GrogVix [38]
3 years ago
12

Write a program that outputs a subtraction practice problem for a student, outputting the larger random number

Computers and Technology
1 answer:
PolarNik [594]3 years ago
5 0

Answer:

#include <stdio.h>

#include <stdlib.h>

#include <time.h>

int main(void)

{

   srand(time(NULL));

   int num1, num2;

   int val;

   while (true)

   {

       num1 = rand() % 100 + 1; //Random number between 1-100

       num2 = rand() % 100 + 1; //Random number between 1-100

       if (num1 >= num2)

       {

           printf("%d - %d = ", num1, num2);

           scanf("%d",&val);

           if (val == num1-num2)

           {

               printf("Correct!\n");

           }

           else

           {

               printf("Incorrect!\n");

           }    

       }

       else

       {

           printf("%d - %d = ", num2, num1);

           scanf("%d",&val);

           if (val == num2-num1)

           {

               printf("Correct!\n");

           }

           else

           {

               printf("Incorrect!\n");

           }

       }    

   }

}

Explanation:

First, we create two random numbers and save the values.  Then we check to see which value is larger.  Based on that, we change how we display the format to the user.  Then we check to see if the user input number is equivalent to the subtraction problem.  If it is, we display Correct!  Else, we display Incorrect!

Cheers.

You might be interested in
You have been asked to implement enterprise software for a manufacturer of kitchen appliances. What is the first step you should
Amiraneli [1.4K]

Answer:

Option E i.e., Select the functions of the system you wish to use is the correct answer.

Explanation:

In the above statement, some part of the question is missing that is options.

The first step is taken by the user is that they have been select those methods of the computer system which he wants to use firstly if he has to implement the software or an application for that manufacturers who sales the appliances of the kitchen. Then, it is necessary to take the following steps by the user according to its needs.

8 0
3 years ago
Give two differences between ergonomic keyboard and standard keyboard?​
galina1969 [7]

Answer:

The biggest difference between enhanced keyboards is the 12 function keys running across the top of the keyboard, instead of 10 that run down the left side. Other changes include the addition of extra Ctrl, keys, Alt keys, and cursor arrow keys between the letter keys and numeric keypad on the right side.

Explanation:

5 0
3 years ago
Samantha received a gaming session as a gift. She would like to have it communicate with her sister Jennifer’s gaming system so
WARRIOR [948]

Answer:

Wi-Fi Direct

Explanation:

Wi-Fi Direct is a Wi-Fi standard for peer-to-peer wireless connections that allows two devices to establish a direct Wi-Fi connection without an intermediary wireless access point, router, or Internet connection.

3 0
4 years ago
A student is conducting an experiment in which he adds an inhibitor to an enzyme-catalyzed reaction that contains alkaline phosp
Zigmanuir [339]

Answer:

competitive

Explanation:

An inhibitor is a substance that hinders the action of an enzyme. An inhibitor may be competitive or non competitive.

A competitive inhibitor is an inhibitor that is very similar to the substrate hence it binds to the enzyme instead of the substrate. A noncompetitive inhibitor binds to a site that is different from the active site. This site is called an allosteric site.

If we look at the experiment described in the question, the reaction rate decreases upon addition of the inhibitor. This effect is reversed by adding a large quantity of substrate.

The implication of this observation is that the enzyme and the inhibitor compete for the active site on the substrate.

Hence the inhibitor is a competitive inhibitor.

7 0
3 years ago
What is professional education? <br><br><br><br><br>Please help me to do this.​
allochka39001 [22]

Answer:

Professional education is a formalized approach to specialized training in a professional school through which participants acquire content knowledge and learn to apply techniques. Although content is what the participant is expected to learn by attending professional school, such an education also helps the participant acquire the competencies needed for proper practice and behavior. Some common goals of professional education include incorporating the knowledge and values basic to a professional discipline; understanding the central concepts, principles, and techniques applied in practice; attaining a level of competence necessary for responsible entry into professional practice; and accepting responsibility for the continued development of competence. It is designed to produce responsible professionals and then to ensure their continuing competence in the profession by helping them recognize and understand the significance of advancing professional knowledge and improving standards of practice. It involves the translation of learning to practice and is intended to prevent occupations and professionals from becoming obsolete.

Explanation:

7 0
3 years ago
Read 2 more answers
Other questions:
  • When creating wireframe geometry and the autocursor is on what happens when you push the shift key?
    13·1 answer
  • Recursive Power Function Write a function that uses recursion to raise a number to a power. The function should accept two argum
    15·1 answer
  • Because a vector container uses a dynamically allocated array to hold its elements,
    5·1 answer
  • The conscious process of planning and controlling how you spend your time is called?
    15·1 answer
  • Online retailer Amazon relies heavily on a hierarchy culture to manage its vast and complex shipping processes. ___________ are
    11·1 answer
  • What will you do to run a presentation from a computer on which you did not prepare the presentation, and how?
    13·1 answer
  • What is the purpose of a Macro in Word?: *
    13·1 answer
  • What breakthrough in sound recording facilitated stereophonic recording? Ο Α. overdubbing O B. multitrack recording O C. digital
    10·1 answer
  • What are the common internal components to most electronic devices?
    10·1 answer
  • A _____ shows how data moves through an information system but does not show program logic or processing steps.
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!