But dis program works weird. It works for inputs like 9 3,8 3, etc.., but doesnt work for 8 2, and other higher inputs. Can ny1 plz help me wid dis??

# include <stdio.h>
# include <conio.h>
void main()
{
clrscr();
int a,b,i;
printf("2 numbers : ");
scanf("%d %d",&a,&b);
if (b==0)
printf("invalid input");
if(a>=b)
{
for(i=1;i<=a;i++)
{
a=a-b;
if(a<b)
{
printf("remainder is %d and Quotient is %d",a,i);
break;
}
}
}
else
printf("remainder is %d and Quotient is 0",a);
getch();
}
