#include<iostream>
usingnamespace std;
int main()
{
int odd=0,ctr;
for(ctr=0;ctr<100;ctr++)
{
if (ctr%2==1)
{
cout<<ctr<<"\n";
}
elsecontinue;
}
for (ctr=0;ctr<100;ctr++)
{
if (ctr%2==1)
odd=odd+ctr;
}
cout<<"The sum of odds is: "<<odd<<"\n";
return 0;
}
#include<iostream>
usingnamespace std;
int main()
{
int odd=0,ctr;
for(ctr=0;ctr<100;ctr++)
{
if (ctr%2==1)
{
cout<<ctr<<"\n";
odd=odd+ctr;
}
elsecontinue;
}
cout<<"The sum of odds is: "<<odd<<"\n";
return 0;
}
Im just not at a place where theres a compiler to test if it works...