I have a logical problem that i want to divide any number by 2. i.e 4/2 the answer is 2 & the remaining is Zero. If i divide 5/2 then the remaining woule be 1.

My problem is that either i input 4 or 5 value in num the ELSE statement always execute. There is a logical error in my coding. I want that if i divide 4/2 then the remainder is Zero so the statement after if should be executed other wise the else statement but here always my else statement execute.

Please help how can i solve my Logical error. Thanks in Advance...

#include<stdio.h>

#include<conio.h>

void main()

{

int num,div;

clrscr();

printf("\n\tEnter any value = ");

scanf("%d",&num);

div=num/2;

if (div==0)

printf("\n\tRemaining is zero");

else

printf("\n\tRemaining is One");

getch();

}