Saturday 7 July 2012

Lecture: 112


                                                Lecture 112

// Loop do while
#include <iostream>
#include <conio.h>
using namespace std;
 main ()
{  
      int i,sum=0;
      i=1;
      do
      {
         sum+=i;             
         i++;
      }while(i<=20);
      cout<<"1 to 20 number of Sum:  "<<sum;
         
  getch();
  return 0;
}
Code view in dev compiler:

Compile the program Ctrl+F9

      Run program Ctrl+F10