home *** CD-ROM | disk | FTP | other *** search
/ Shareware Supreme Volume 6 #1 / swsii.zip / swsii / 099 / IOSTREAM.ZIP / EX_I26.CPP < prev    next >
C/C++ Source or Header  |  1993-01-07  |  382b  |  24 lines

  1.  // EXAMPLE INPUT-31
  2.  
  3.  // ENTER A NUMBER AND LOOP
  4.  // UNTIL EOF IS DETECTED
  5.  
  6.  #include <header.h>
  7.  
  8.  int main()
  9.  {
  10.     cout << "Enter a number: " ;
  11.     int num ;
  12.     cin >> num ;
  13.     while (!cin.eof())
  14.     {
  15.        cout << "You entered: "
  16.             << num
  17.             << '\n' ;
  18.        cout << "\nNext number: " ;
  19.        cin >> num ;
  20.     }
  21.  
  22.     return 0 ;
  23.  }
  24.