3. After following statements have executed, find the value of the variable a.
int a=5;
while (a<20)
a=a+3;
4. After following statements have executed, find the value of the variable a.
int a=0;
while (a<12)
a++;
5. After following statements have executed, find the value of the variable a.
int a=15;
while (a>0)
a=a-3;
6. After following statements have executed, find the value of the variable a.
int a=2, i=0;
while (i<=5){
a=a+i;
i++;
}
7. After following statements have executed, what will be appear on the output window
int i=0, a=0;
while(i<10){
a=a+i*i;
i=i+2;
cout<<a<<endl;
}
8. After following statements have executed, what will be appear on the output window
int i=10, a=0;
while(i>3){
a=a+i*i;
i=i-2;
cout<<a<<endl;
}
Just write the answers.
1 answer
better yet, why don't you just execute the code?