Hi I wrote this code to print out factors of an integer with a for looop
how do i write it with a while loop?
for(int i = 1; i < integer+1; i++) {
int i = 1; while(i < integer + 1) { // your current loop body goes here i++; }
See equivalent forms of for loop.