Why does the value of i after for loop becomes 0 if we write int i in the loop?
However if we just write i in for loop it gives updated value of i
using namespace std;
int main() {
char s[1000];
cin>>s;
int i=0;
for(i=0;s[i+1]!=’\0’;i++)
{ int c=s[i+1];
int b=s[i];
int n=c-b;
cout<<s[i]<<n;
}
cout<<s[i];
return 0;
}