Can I use a return command instead of printf in the tables1 function, and still get the same output as it is giving me currently? The tables1 function is defined at the starting of the following code which presently executes without warnings or errors:-
#include <stdio.h>
#include <stdlib.h>
#include <conio.h>
float tables1(float a,float b)
{
int i=0;
for(i=0;i<=10;i++)
{
printf(" %.2f\n", a*i);
printf(" %.2f\n ", b*i);
}
printf(" if all tasks not executed plz check the code \n");
printf("just to check how the computer treated your number input as, lets print it again\n %.2f \n", a);
return 0;
}
int main()
{
float a,b;
printf("enter the numbers whose first 10 multiples u want to see\n");
scanf("%f", &a);
scanf("%f", &b);
printf("following below are the multiples \n\n ");
tables1(a,b);
return 0;
}
The output image is attached.
Also, when i wrote the above code initially, i did not write any return statement in the tables1 function definition, hence i got a warning during build, so just to see if it works, i wrote a return 0; compiled it, and the warning was gone yet, leaving me in dissatisfaction from a second query which is:- Doesnt the float function have a different kind of return statement, or is return 0 rightly used? i feel there may be couple of such instances(like mistakes) in my program that may have gone unnoticed by me.

printfdoes something visible,return a;does not. It's also a nonsensical return value: it's the sameathat you fed the function with, and it doesn't get modified.