1Use a counter named p that has an initial value of 3 a fina
1)Use a counter named p that has an initial value of 3, a final value of 18, and an increment of 1.
2)Use a counter named count that has an initial value of 1, a final value of 20, and an increment of 5.
3)Use a counter named j that has an initial value of 30, a final value of 10, and a decrement of 5.
4)Use a counter named price that has an initial value of 5, a final value of 15, and an increment of .5.
5)Use a counter named jcount that has an initial value of 20, a final value of 1, and a decrement of 2.
Solution
Question 1:
Answer:
for(int p=3; p<=18; p++){
}
Question 2:
Answer:
for(int count=1; count<=20; count+=5){
}
Question 3:
Answer:
for(int j=30; j>=10; j-=5){
}
Question 4:
Answer:
for(int price=5; price<=15; price+=5){
}
Question 5:
Answer:
for(int jcount=20; jcount>=1; jcount-=2){
}
