SUM USING FOR LOOP SUM OF ALL EVEN NUMBERS

  

#include <iostream>


using namespace std;


int main()

{    int sum = 0;

     for( int i = 0; i<=90; i= i+2 ){

         cout<<i<<endl;

        //  cout<<i<<endl;

         sum = sum + (i);

     }

      cout<<"the sum is "<<sum<<endl;


    return 0;

}


Comments

Popular posts from this blog

250+ C Programs for Practice

FUNCTION OVERRIDING IN CPP