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]
2 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]2 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
How did technology change the world
Crank

Answer:

Technology has changed the world for the better.

Explanation:

Without technology, many of the things we take for advantage, such as, credit cards, calling people from far distances, heck even being able to call to across the world from where you are right now. Technology has revolutionized many things we use commonly on a day-to-day basis.

3 0
2 years ago
Read 2 more answers
We are continuously sending and receiving messages that may change midstream. This illustrates that____________.
8_murik_8 [283]

Answer:

Communication is a constant process and it can also be corrupted.

Explanation:

Communication is the ability to send and receive messages that can be understood. We constantly communicate with our environment verbally and or orally, using signs and language to express ourselves.

Messages sent can and should be decoded for communication to be complete. It can be corrupted on its path to the decoder, this hinders understanding.

6 0
3 years ago
What would you need to have on your foley stage
LUCKY_DIMON [66]
<span>You will need many props for your Specific tracks (whatever you see in the film!). It's impossible to say what you will need until you see the picture and as time goes by you will add to your collection (if you have space!) - garbage day in my neighborhood is 'golden day' as I collect some of best props from the stuff people throw out: old bicycles, doors, sinks, wood, metal, desks, etc.</span>
4 0
3 years ago
Sharon is responsible for the security on web applications. She’s looking to see if all applications have input validation. What
LiRa [457]

Answer:

Options Include:

<em>A) Server-side validation </em>

<em>B) Client-side validation </em>

<em>C) Validate in trust </em>

D) Client-side and server-side validation

<em>Client-side and server-side validation is Correct</em>

Explanation:

The best option is to validate the client side with the server side. Using these together would provide the best testing option for Sharon.

<em>This keeps user feedback instantly without wasting postbacks while also protecting against JavaScript disabled users. That's how the validation controls for ASP.NET operate. </em>

This is definitely not over-engineering as there are risks of using one without the other.

Individual validation on the server side and individual validation on the client side are both incorrect. Trust validation is not a form of validation.

4 0
3 years ago
PLEASE HELP ME! Will report ignorant answers!
kaheart [24]

Answer:

It is important so your computer can function properly. the two things that might happen if they are not compatible are that it might crash your computer and that your computer might not function properly.

5 0
2 years ago
Other questions:
  • PLEASE HELP ON THESE 3!! ILL GIVE A BRAINLIEST IF ITS CORRECT!!
    7·1 answer
  • Software obtained illegally is called open-source software. true / false
    15·1 answer
  • The measure of the maximum amount of data that can travel through a computer’s communications path in a given amount of time is
    9·1 answer
  • Consider the following sequence of items 10, 36, 25, 54, 37, 12, 75, 68, 42, 86, 72, 90. Insert these items in the order above,
    5·1 answer
  • To reduce inflation, the Federal Reserve _____ the money supply. This action also causes the economy to shrink.
    13·2 answers
  • What is the purpose of filters in a data base
    11·1 answer
  • Stating a document is PDF or XPS document refers to document _______​
    10·1 answer
  • What is the first priority when building or using vex robots
    10·2 answers
  • Two time series techniques that are appropriate when the data display a strong upward or downward trend are ___________ and ____
    14·1 answer
  • Multiple Choice
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!