I have a problem with while loop in c++. I write this code:
#include <iostream.h>
main () {
int a, av = 0;
cout << "Enter a number: ";
cin >> a;
for (int i = 1; i <= a; i++) {
while (av == 1) {
cout << "abc" << a / i;
if (a % i == 0) {
av = 1;
}
}
}
}
This program should print "abc", but it doesn't print any thing. I know the problem is in while section, but how can I fix it? Thanks ..