I just started learning programming and I have been trying to write a very simple program that takes two integer numbers and divides them. I don't know what's wrong with my code. It works fine for some cases but other times it returns 0;
#include<stdio.h>
int main()
{
int a,b;
scanf("%d%d",&a,&b);
double D= a/b;
printf("%.4lf",D);
}