I need to find S and please explain how did you find S in N is 4

#include <iostream>

int main ()
{

int n,i,s;

cout<<"Put the number of n"<<endl;
cin>>n;

s=0
for (i=1;i<=n;i++)
s=s+i
cout<<"S is<<s<<endl;
return 0
}