0
When we want to add 5 numbers which are entered by the user then why we use the variable num
please
2 Respuestas
+ 16
You can use any variable name
+ 7
double input,num;
for(int x =0;x<5;x++){
cin >> input;
num = num + input;
}
cout<<num;
num could be anything...
This is needed to temporarily store addition of all the numbers , one by one ,via a loop, in a variable Hope that makes sense.