0
cout<<"sal["<<i<<"] : "<<sum<<endl;
I din understand that why we are putting i square bracket.how it is working??? Arrays concept.
2 Answers
+ 1
Well, it's not an array concept since the code above simply prints out the square brackets.
here's how it executes:
sal[I] : sum
since you hadn't show the values of variable 'i' and 'sum' so I written the name of the variable instead writing the value of variable.
0
Yes. To get the output like this, example :
sal[0] : 1000
sal[1] : 2000
sal[2] : 3000
...
...
..
..
Everything you write in between "" (double quotes) is becomes a string...., so only there i and sum are variables, remaining are string only..