// Justin C. Miller
// University of Wisconsin Oshkosh
// Made for: http://www.geocities.com/neonprimetime.geo/index.html
// Date: 2001
// Borland Builder 4.0
// adds up the total of the odd numbers from 1 - n
#include
int main()
{
int sum = 0 ;
cout << "Will print out the total of the first" << endl ;
cout << "n odd numbers." << endl ;
cout << "Please enter in n" << endl
int n ;
cin >> n ;
for ( int x = 1 ; x <= n ; ++x )
{
if ( ( x % 2 ) != 0 )
{
sum += x ;
}
}
cout << sum << endl ;
return 0 ;
}
               (
geocities.com/neonprimetime.geo/cpp)                   (
geocities.com/neonprimetime.geo)