write a program in c++ to calculate the sum of all even numbers till 100
Answers
Answered by
3
int main ()
{
int x ,sum=0;
for (int I=0,I <=100,I++)
{
if (x%2==0)
{
sum++;
}
else
{
cout<<"not even";
}
}
close();
}
{
int x ,sum=0;
for (int I=0,I <=100,I++)
{
if (x%2==0)
{
sum++;
}
else
{
cout<<"not even";
}
}
close();
}
Similar questions