Question: i have a question about for loops. Q1:So lets say we have an action in order from x= 0 to x=5 i want the loop
i have a question about for loops.
Q1:So lets say we have an action in order from x= 0 to x=5 i want the loop to go increment from 0 to 5, how would i make the for loop run from y=5 to 0 in the same for loop? would it be something like this:
for(i=0,j=5 ; i<6,i>=0;i++,j--){
x=i;
y=j;
}
Q2:
is for loop from Q1 same as this:
for(i=0;i<6; i++){
x=i;
}
for(j=5;j>=0;j--){
y=j;
}
Q3: From Q1 can i just make y=~i instead of y=j ?
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
