Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
C++ - 24 - While ( Codes )
#1
Code:
#include <iostream>

using namespace std;

int main()
{   /*int i = 3;
   while(i>=0){
       ///true-code
       cout << "Hello\n";
       --i;
   }
   cout << i << endl;
   cout << "Done\n";
   */
   int i = 1, total = 0;
   while(i<=100){
       total += i;
       i++;
   }
   cout << total;
   return 0;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)