//
//  break_example.c
//
//  This program provides an example of using
//  the break statement
//
//  Created by Julio Bahamon on 05/29/2017.
//  Copyright © 2016 Julio Bahamon. All rights reserved.
//

#include <stdio.h>


int main()
{
   int n;
   int n_square;
   
   
   // Use an infinite loop to continue
   // processing user input until an exit
   // condition is detected
   for (;;)
   {
      printf("Enter a number [0 to exit]: ");
      scanf("%d", &n);
      
      if (n == 0)
         break;
      
      n_square = n * n;
      printf("%d squared = %d\n", n, n_square);
   }
   
   
   return 0;
}