I want to output the results of several arithmetic operations using printf.
First I read some data using scanf and perform calculations on those values.
Here is my code:
int main() {
int n,a,b,c,e,f;
scanf("%d%d%d%d%d%d", &n, &a, &b, &c, &f, &e);
printf("Addition of (%d+%d) = %d\n", n, a, (n+a));
printf("Substraction of (%d-%d) = %d\n", n, b, (n-b));
printf("Multiplication of (%d*%d) = %d\n", n, c, (n*c));
printf("Reminder of (%d%%d) = %d\n", n, f, (n%f));
printf("Quotient of (%d/%d) = %d", n, e, (n/e));
return 0;
}
However, when I try to compile that source I obtain the error message:
Solution.c:14:12: warning: too many arguments for format [-Wformat-extra-args]
printf("Reminder of (%d%%d) = %d\n",n,f,(n%f));