So they gave me this code and asked me to find its errors.
Code:
#include <stdio.h>
int main(){
float a, b, c;
scanf(“%f %f”, &a, &a);
mult(a, b, c);
printf(“%f\n”, c);
return 0;
}
void mult(float x, float y, float z) {
z = x * y;
}
And my resolution is (full of mistakes):
Code:
#include <stdio.h>
void mult(float x, float y, float z);
int main(){
float a, b, c;
scanf(“%f %f”, &a, &b);
mult(a, b, c);
printf(“%f\n”, c);
return 0;
}
void mult(float x, float y, float z) {
float z = x * y;
return z;
}
I know its related to the mult function but i don't know what to do with it . Thanks