I can't use i/10 in **FOR LOOP, C++. Can you please find why I can't use that!! when I write the code below;
#include <iostream>
using namespace std;
int main()
{
int sum=0,i;
cout<<"enter a no.";
cin>>i;
for(i;i!=0;i=i/10)
{
sum=sum+i%10;
}
cout<<"sum="<<sum;
}
After compiling it shows that:-
cpp_2.cpp:8:7: warning: statement has no effect [-Wunused-value]
for(i;i!=0;i=i/10)
Please help me!!