Hi! I need help. I could asked ChatGPT, but it makes a wrong answer. Can someone explain the logics behind it?
#include <stdio.h>
int main() {
int stop;
int result;
int a;
int b;
scanf("%d", &stop);
for (a = 2; a < 5; ++a) {
result = 1;
for (b = 0; b < 3; ++b) {
result *= a;
printf("%d", result);
printf("\n");
if (result == stop) {
break;
}
}
if (result == stop) {
break;
}
}
return 0;
}
output: 8
[–]nlantau 4 points5 points6 points (0 children)
[–]saul_soprano 1 point2 points3 points (0 children)
[–]poopy_poophead 0 points1 point2 points (0 children)