I'm having problems with my do/while loop. It does not take the condition and simply continues the loop indefinitely. I have:

do
{
   printf("Choose the base of the number to convert:\n\n");
   printf("2    5    8    10    16\n\n");
   printf("Enter option:");
   scanf("%d", &baseFrom);
   system("cls");
   if(baseFrom != 2 || baseFrom !=5 || baseFrom != 8 || baseFrom != 10 || baseFrom != 16)
      printf("Incorrect choice, please try again.\n\n");
} while( baseFrom != 2 || baseFrom !=5 || baseFrom != 8 || baseFrom != 10 || baseFrom != 16);

I even tried it with cin cout and still gives the same outcome: the loop just continues

> baseFrom != 2 || baseFrom !=5
So you type in 2
The first one becomes false (good)
The second one (and all the others) remain true (not so good)

You probably want && , not ||

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.