Well, I'm tryin to make a for loop that computes the sum of the odd numbers in the range from 0 to 100.
So far i have
#include <iostream>
#include <iomanip>
using namespace std;
int main()
{
int odd = 1;
}
i need a FOR (something,some thing,something )
and an IF statement.
and then i dont know what to do for the rest of the part... =(
i know if you add like all the odd numbers from 1 to 100 it would equal 3000.
how would i just take the odd numbers and add them all together using a for loop?
Please Reply If you know the answer to my question
So far i have
#include <iostream>
#include <iomanip>
using namespace std;
int main()
{
int odd = 1;
}
i need a FOR (something,some thing,something )
and an IF statement.
and then i dont know what to do for the rest of the part... =(
i know if you add like all the odd numbers from 1 to 100 it would equal 3000.
how would i just take the odd numbers and add them all together using a for loop?
Please Reply If you know the answer to my question
Comment