#include<iostream>
using namespace std;
int main()
{
int i(0),sum(0);
while(i<=1000)
{
sum+=i;
i++;
i++;
}
cout<<"sum="<<sum<<endl;
return 0;
}
#include<iostream>
using namespace std;
int main()
{
int i(0),sum(0);
do
{
sum+=i;
i++;
i++;
}
while(i<=1000);
cout<<"sum="<<sum<<endl;
return 0;
}
#include<iostream>
using namespace std;
int main()
{
int i,sum=0;
for(i=0;i<=1000;i=i+2)
{
sum=sum+i;
}
cout<<"sum="<<sum<<endl;
return 0;
}