I'm new here i just started C++ about two weeks ago, so im still a beginner here. I need help from anyone of u guys to detect any errors. I wrote a "while loop" to determine a total even numbers of a range but it cant work.
#include<iostream>
using namespace std;
int main()
{
int range;
int cnt=1,even=0;
cout<<"Please enter the range number:"<<endl;
cin>>range;
if(range>=0 && range<=200)
while(cnt<=range)
{ if((cnt%2)==0)
even++;
cnt++;}
system("PAUSE");
return 0;
}