Very simple Function using printf()
This code uses a simple function that takes two arguments and just prints them. This is easy when using two int (%d) arguments. However, I want to take two double arguments (i.e. integers with decimal points) but once I start messing with the format specifiers the output goes mental. What am I doing wrong?
Any guidance most gratefully received.
void printfunc(int, int);
int dub1, dub2;
printf("Enter two decimal integers.\n");
scanf("%d %d", &dub1, &dub2);
printf("Cheerio for now.\n");
void printfunc(int a, int b)
printf("%d %d\n", a, b);
To clarify, I need to alter the function to be able to take two double arguments (e.g 1.2 and 56.3) and simply print them, i.e. void printfunc(double, double)