Very short code tt never work...please help
The code looks like this (got this from dev++ C tutorial):
The problem is after the prog prompt me for the second no, and after I enter and hit the 'Enter' key, the whole program disappears - failing to print either the statements, "Cannot devide by zero" or "Answer is...".
int num1, num2;
printf("\nEnter first number ");
printf("\nEnter second number ");
if (num2 ==0) printf("\n\nCannot devide by zero\n\n");
else printf("\n\nAnswer is %d\n\n",num1/num2);
Tried different compiler like Borland and also replacing scanf with getchar - and still get the same thing. Wat is wrong???
Thanks a zillion for your help.