Starting from:

$30

CPT120-Tutorial 12 Mystery Program Solved

convert the Java program below to either a C or a Python (version 3) program. Your code does not need to be tested and it is fine if it has syntax errors.
public class MysteryProgram { public static void main(String[] args){

int a=1680; int b=a/2; int c=1; while(c<=(a/c)){ if (a%c==0){

System.out.print(c+" x "+(a/c)+" = "+a+"\n");

} c+=1;

}

}

}

More products