It's really complicated to me as a beginner to do it so I tried this code :
int x,sum=0;
while (x)
cin >> x;
sum+=x;
cout << sum ;
I want to let the program when the user enters "0" the program should print the sum of these numbers entered by the user.