C++ Programming Blog

 
 
 

Image

 #include<iostream.h>
 #include<conio.h>



 //-----------------------------  Main( )  -------------------------------//



 main()
    {
       clrscr();

       int sum=0;

       for(int count=1;count<=10;count++)
      sum=sum+count;

       cout<<\"\\n The sum of first ten integers = \"<<sum<<endl;

       getch();
       return 0;
    }

 
 
Didn't find what you were looking for? Find more on Program that computes and display the sum of first ten integers. (using for loop)