Aligning If, Then, Else Statements

liunx

Guest
I am supposed to design a program with a loop that lets the user enter a series of numbers and enter -99 to signal the end. And it also has to display the largest and smallest numbers entered. I chose to say only 3 numbers because I thought it would help with the length of the program. I am getting confused on the If, Then, Else statement alignment and also where to put the -99 to end the program. Everything is starting to run together. I just need some clarification on what I'm doing. I'm doing the very basic, there isn't a specific programming code that's used. By the way, I am Very new at programming but here's what I have so far.<br /><br /><!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1--><br /><br />Display "Enter a series of 3 numbers (or -99 to end)”<br /><br />Display "Enter first number.”<br />Input num1<br />Display "Enter second number.”<br />Input num2<br />Display "Enter third number.”<br />Input num3<br /><br />If num1>=num2 Then<br />    If num1>=num3 Then<br />      Display "Largest Number is , "num1”<br />    Else<br />        If num2<=num3 Then<br />                 Display "Smallest Number is , "num2”<br />        Else <br />                      Display "Smallest Number is , "num3”<br />      Else<br />             Display "Largest Number is , "num3”<br />                     Display "Smallest Number is , "num2”<br />      Else<br />                     If num2>=num3 Then<br />                            Display "Largest Number is , "num2”<br />                     If num1<=num3 Then<br />                            Display "Smallest Number is , "num1”<br />                Else<br />                     Display "Smallest Number is , "num3”<br />                Else<br />                     Display "Largest Number is , "num3”<br />                     Display "Smallest Number is , "num1”<br />                End If  <br />End If<br /><br /><!--c2--></div><!--ec2-->
</div>
 
Top