int sum=0;
for (int i=1; i<=100; i++)
{
if (i-2*(i/2)==0)
sum=sum+i;
}
System.out.println("Sum="+sum);
//use do while
int i=1, sum=0;
do{
if (i-2*(i/2)==0)
sum=sum+i;
}while (i<=100)
System.out.println("Sum="+sum);
#include
using namespace std;
int main()
{
int sum=0;
for(int i=2;i<=100;i+=2)
sum+=i;
cout<
}
#include
using namespace std;
int main()
{
int sum=0;
int i=2;
while(i<=100)
{
sum+=i;
i+=2;
}
cout<
}