Pastebin launched a little side project called HostCabi.net, check it out ;-)Don't like ads? PRO users don't see any ads ;-)
Guest

Loop

By: NewbProgrammer on Dec 17th, 2012  |  syntax: C++  |  size: 0.61 KB  |  hits: 31  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1.      for(int i = 0; i < 4; i++)
  2.      {
  3.              int quarter = 1;
  4.              cout << "Enter the name of the division: ";
  5.              cin >> div.divName[i];
  6.              for(int i = 0; i < 4; i++)
  7.              {
  8.                   cout << "Enter in the sales for quarter "<< quarter <<": ";
  9.                   cin >> div.sales[i];
  10.                   if(div.sales[i] > 0)
  11.                   {
  12.                        quarter++;
  13.                   }
  14.                   else
  15.                   {
  16.                        cout << "Sales are not allowed to be negative.\n";
  17.                   }
  18.              }
  19.      }