Compiling with warnings enabled would have told you something was wrong from the start, without the "hours of coding".
Code:
$ cat foo.c
#include<stdio.h>
void divide(int dividend, int divisor, int *quotient, int *remainder)
{
*quotient = dividend / divisor;
*remainder = dividend % divisor;
}
int main()
{
double dividend, divisor, quotient = 0;
int remainder = 0;
printf("Enter Dividend: ");
scanf("&d", ÷nd);
printf("Enter Divisor:");
scanf("&d", &divisor);
}
$ gcc -Wall foo.c
foo.c: In function ‘main’:
foo.c:13:9: warning: too many arguments for format [-Wformat-extra-args]
scanf("&d", ÷nd);
^
foo.c:15:9: warning: too many arguments for format [-Wformat-extra-args]
scanf("&d", &divisor);
^
foo.c:11:7: warning: unused variable ‘remainder’ [-Wunused-variable]
int remainder = 0;
^
foo.c:10:29: warning: unused variable ‘quotient’ [-Wunused-variable]
double dividend, divisor, quotient = 0;
^
$