int mul (int a, int b);

main()

{

int a, b, c;

a = 5;

b = 10;

c = mul (a,b);

printf ("multipilcation of %d and %d is %d",a,b,c);

}

int mul (int x, int y)

int p;

{

p = x*y;

return(p);

}

0 votes

int mul (int a, int b);

main()

{

int a, b, c;

a = 5;

b = 10;

c = mul (a,b);

printf ("multipilcation of %d and %d is %d",a,b,c);

}

int mul (int x, int y)

{

int p;

p = x*y;

return(p);

}

0 votes

int p in mul function definition is not inside the function make it declare in the function and give return 0 in main function

0 votes

In the above program, during the declaration of function you have written

int mul(int a,int b);

and when you have defined te function then you have written

int mul(int x,int y)

which is absolutely wrong. So your function should be defined like this :-

int mul(int a, int b)

int mul(int a,int b);

and when you have defined te function then you have written

int mul(int x,int y)

which is absolutely wrong. So your function should be defined like this :-

int mul(int a, int b)

0 votes

#include <stdio.h>

int main()

{

int a, b, c;

a = 5;

b = 10;

c = mul (a,b);

printf ("multipilcation of %d and %d is %d",a,b,c);

}

int mul (int x, int y)

{

int p;

p = x*y;

return(p);

}

int main()

{

int a, b, c;

a = 5;

b = 10;

c = mul (a,b);

printf ("multipilcation of %d and %d is %d",a,b,c);

}

int mul (int x, int y)

{

int p;

p = x*y;

return(p);

}

0 votes

You opened a brace after the first statement "**int p;**", where it should be after the function begins(before the statement). The entire function should be wrapped inside the braces.

int mul (int x, int y)

{int p;

p = x*y;

return(p);

}

0 votes

Curly brace for function needs to be before int p; like ...int y){

Recommend defining function before main since easier to understand. This works:

#include <stdio.h>

int mul(int a, int b){

int p = a*b;

return p;

}

void main()

{

int a, b, c;

a = 5;

b = 10;

c = mul(a,b);

printf ("multipilcation of %d and %d is %d",a,b,c);

}

Recommend defining function before main since easier to understand. This works:

#include <stdio.h>

int mul(int a, int b){

int p = a*b;

return p;

}

void main()

{

int a, b, c;

a = 5;

b = 10;

c = mul(a,b);

printf ("multipilcation of %d and %d is %d",a,b,c);

}

0 votes

use int p;

inside the function, basically inside the flower brackets or globally after the function declaration

int mul(int, int)

{

int p;

}

inside the function, basically inside the flower brackets or globally after the function declaration

int mul(int, int)

{

int p;

}

...