Computer Science, asked by gokublack91, 1 year ago

write the output step by step of the following:-
int a,b,s;
s=0;
for(a=1;a<=20;a=a+5)
{
s=s+a;
a=a+5;
}
cout<<"SUM="<<s<<endl;
getch();
}

Answers

Answered by Ankitparmar
1
first
s=0+1
s=1
a=1+5
a=6
second
s=1+6
s=7
a=6+5
a=11
third
s=7+11
s=18
a=11+5
a=16
and further on

gokublack91: so the answer will be displayed 16 ?
Similar questions