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
Virty [35]
3 years ago
15

NOTE: in mathematics, the square root of a negative number is not real; in C therefore, passing such a value to the square root

function is an error. Given a double variable named areaOfSquare write the necessary code to read in a value, the area of some square, into areaOfSquare and print out the length of the side of that square. HOWEVER: if any value read in is not valid input, just print the message "INVALID".
Computers and Technology
1 answer:
Tanya [424]3 years ago
4 0

Answer:

# include<math.h>

# include<stdlib.h>

# include<stdio.h>

int main()

{

    int choice;

    double area;

    printf("Enter the area of Square:");

    scanf("%lf", &area);

    printf("Enter the choice: 1, 2:");

    scanf("%d", &choice);

    switch(choice)

    {

        case 1:if(area<0.00)

                        {

                        printf(" INVALID");

                        break;

                        }

                      else

                        {

                        printf("side of square: %lf", sqrt(area));

                        break;

                       }

                       break;

        case 2: break;

    }

return 0;

}

Explanation:

Here, if area is less than 0 then invalid message is printed out. And if area is more than 0 then the sqrt is calculated and the side of a square length is being printed out. And that is what is required. lf is for double. And math.h is included to make use of the sqrt function.

You might be interested in
What internal hardware device does a computer use to connect to a wired or a wireless network?
IrinaVladis [17]

Answer:

it will be ethernet and wireless network adapter

Explanation:because, wireless card is will able to connect to network wirelessly ,ethernet card will connect to network with ethernet cable RG45

if you give more info about your question will; try to help you better.

Thanks

8 0
3 years ago
When you heat a pot on a stove, the handle gets warm. which type of heat transfer is possible
valina [46]

Answer:

conduction

Explanation:

The handle will warm up until it's total heat losses equal the total heat coming in. Heat comes in mostly by conduction from the body of the pot.

5 0
3 years ago
Read 2 more answers
What does the headgear of a mine do
deff fn [24]
Hard to answer to short but I will try the head gear let's you talk to people on the internet
5 0
3 years ago
Read 2 more answers
Ted has $55.00 in his pocket. Which purchase will he be able to pay for with cash?
Alex73 [517]
You just need a little bit of math to solve this. Add up the items and see which one would be equal to $55.00 or less. 

A = $59.90 so this is not the answer
B = $60.94 so this is not the answer
C = $55.99 so this is not the answer

D = $50.97 

D is the correct answer.
3 0
3 years ago
Read 2 more answers
Your company is trying to get out of the responsibility of purchasing and hosting its own hardware so it won’t have to finance o
kotykmax [81]
The answer is Software as a Service (SaaS).

SaaS is one of the 3 main categories of cloud computing. In SaaS, a 3rd party provider hosts applications and make them available to customers over the internet. It removes the need for businesses to install and run applications on their own data centers or computers. It also eliminates the expense of hardware acquisition and maintenance, as well as software installation and support.
7 0
3 years ago
Read 2 more answers
Other questions:
  • What is the amount of a good or service that business have available to sell?
    13·1 answer
  • Write a program that reads in text from standard input (hint: use Scanner) and prints out the number of words in the text. For t
    5·1 answer
  • 1.) How do parks and other green spaces benefit a community?
    7·2 answers
  • Generate the requested sets using only set builder notation and the provided sets. Some problems may require you to build one or
    15·1 answer
  • Semantic search engines use NLP, contextual cues, synonyms, word variations, concept matching, specialized queries, and other st
    6·1 answer
  • PLEASEEE HELPPP
    7·1 answer
  • What development first helped people shape their communities through<br> informed decisions?
    5·1 answer
  • Features of Python are *
    9·1 answer
  • What is the difference between a field and an infoobject? What is the advantage of using infoobjects instead of fields in an ads
    11·1 answer
  • What are three ways of verifying legitimate right of access to a computer system?
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!