int flag = 0; int price = 0; while (flag==0) { printf(\"\\nEnter Product price: \"); scanf(\"%d\",&price); if (price==0) printf(\"input not
It goes into an infinite loop because scanf() will not consumed the input token if match fails. scanf() will try to match the same input again and again. you need to flush the stdin.
if (!scanf("%d", &sale.m_price)) fflush(stdin);