![princessksh8](/avatars/45823.jpg)
princessksh8
09.09.2020 •
Computers and Technology
keeping one hand in your pocket when working with electricity helps one keep his/herself from becoming part of a circuit this is referred to as the
Solved
Show answers
More tips
- L Leisure and Entertainment How to Make a Crab Trap in Just a Few Minutes...
- H Health and Medicine How Much Does Abortion Cost? Expert Answers and Insights...
- S Sport How to Build Arm Muscles? Effective Exercises and Tips...
- H Health and Medicine When can it be said that a person has a normal pulse?...
- A Art and Culture When Will Eurovision 2011 Take Place?...
- S Style and Beauty How to Choose the Perfect Hair Straightener?...
- F Family and Home Why Having Pets at Home is Good for Your Health...
- H Health and Medicine How to perform artificial respiration?...
- H Health and Medicine 10 Tips for Avoiding Vitamin Deficiency...
- F Food and Cooking How to Properly Cook Buckwheat?...
Answers on questions: Computers and Technology
- C Computers and Technology Q3 Complete the following sentences using the most suitable storage device or medium listed below DVD R fixed hard disk drive memory stick (a) A student taking his coursework...
- E English The period of his reign is called the 18th dynasty. why did the writer capitalize dynasty?...
- E English 4. What does the caption on page 22 (“The Time Period”) help you understand? A “The Monkey’s Paw” is based on a true story. B At the time “The Monkey’s Paw” was written,...
- M Mathematics The same student (as in the previous question) realizes that he has forgotten to zero the balance before measurements of data set #1. after correcting the zero of the balance,...
- M Mathematics Pls help V = 250 mm3 , B =25 mm2, h = ?...
Ответ:
#include <iostream>
using namespace std;
template <typename T> int sgn(T val) {
return (T(0) < val) - (val < T(0));
}
int main()
{
cout << "Enter a number: ";
int number;
cin >> number;
switch (sgn(number)) {
case -1: cout << "The number is negative";
break;
case 0: cout << "The number is zero";
break;
case 1: cout << "The number is positive";
break;
}
}
Explanation:
You need the special sgn() function because a switch() statement can only choose from a list of discrete values (cases).