I need to know how to make this ignore the number 0 when 0 is input so that the program does not exit when 0 is input.
#include <stdio.h>
int main()
{
int input = 0, previous = 0;
do {
previous = input;
printf("Input Number");
scanf("%d", &input);
} while( input!= previous*2 );
return 0;
}
I added an OR operator, that means that if input is equal to 0, then it will still continue, but, if it is not 0, and the second condition is satisfied, it will break the loop and exit.