Sunday 6 May 2012

Lecture 58


                                                Lecture 58

// Loop For
#include <iostream>
#include <conio.h>
using namespace std;
 main ()
{  
      int i,sum=0;
      for(i=1;i<=20;i++)
      {
         sum+=i;             
      }
      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