- 1

Question 2. program that gets a double number from the user, decides whether that number is positive, negative, or zero.

c++

8th Feb 2017, 11:26 PM
Xeng Dalmon
Xeng Dalmon - avatar
4 Antworten
+ 6
# python srry num=int(input()) if num > 0: print("positive") elif num < 0: print("negative") elif num == 0: print("zero") # idk about double numbers that sounds stupid
9th Feb 2017, 2:08 AM
Ahri Fox
Ahri Fox - avatar
+ 4
double number; cin >> number; if (number > 0) { cout << "Positive" << endl; } else if (number < 0) { cout << "Negative" << endl; } else if (number == 0) { cout << "Zero" << endl; }
9th Feb 2017, 2:23 AM
Kawaii
Kawaii - avatar
+ 1
What do you mean by double numbers?
9th Feb 2017, 12:37 AM
Chase
0
A doubled number? U mean like 2 4 6 8 10, etc.?
9th Feb 2017, 10:19 AM
SIMOMEGA
SIMOMEGA - avatar