I am very new to writing in c on terminal for mac and I am attempting to write an integer calculator that has a quotient and remainder, this is what i have written;
When I try to compile I get the error reading:
intdiv.c: In function ‘main’:
intdiv.c:14: warning: useless type name in empty declaration
intdiv.c:20: error: incompatible types in assignment
What am I doing wrong and how can I fix it?
Code:
#include <stdio.h>
#include <stdlib.h>
int
main(void)
{
float numerator, denominator, result;
int quot;
int rem;
div_t;
printf("Please enter numerator.\n");
scanf("%f" ,&numerator);
printf("Please enter denominator.\n");
scanf("%f" ,&denominator);
result=div(numerator,denominator);
printf("That equals %f and the remainder is %f\n", quot, rem);
return (0);
}
intdiv.c: In function ‘main’:
intdiv.c:14: warning: useless type name in empty declaration
intdiv.c:20: error: incompatible types in assignment
What am I doing wrong and how can I fix it?
Comment