12
for(n=1;n<=num;n++) sum+=n;
12345
for(n=1;n<=num;n++) { cout<<n<<" + "; sum+=n; } cout<<" = "<<sum;
123456
for(n=1;n<num;n++) { cout<<n<<" + "; sum+=n; } sum+=n; cout<<n<<" = "<<sum;