I keep getting the wrong answer...I have a homework problem I have been trying to understand but have resulted in a headached.
Using the code shown below, select the correct output for an input of -1:
Input Number
If Number < 0 Then
Write “1”
Else
If Number ==0 Then
Write “2”
Else
Write “3”
End If
End If
Here is my code
#include <iostream>
using namespace std;
int main ()
{
Input Number = -1
if Number < 0 Then
Write “1”
Else
if Number ==0 Then
Write “2”
Else
Write “3”
End if
End if
This C++ is all new to me but I keep getting 1 2 3 4 5 6 as my answer. The answer should be one of the following: 1 2 3 or -1
Any help would be appreciated!