# The following C program i have taken from book but output is not coming- Solution required- kindly help.

asked Apr 3, 2018 1 flag
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);
}

answered Apr 3, 2018 by Yog
Once check this.

#include <stdio.h>
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);
}
commented Feb 25, 2019 by Rahul
c = mul (a,b);
commented Feb 19 by anonymous
Use math .h function
commented Feb 21 by (140 points)
answered Apr 3, 2018 by (140 points)
#include<stdio.h>

int mul (int  *, int *);

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);
}
int mul (int *x, int *y)
{
int p;
p = (*x)*(*y);
return(p);
}
+1 vote
answered Apr 6, 2018 by (320 points)
Actually the program is correct but declaring local variable in function is old-style.so you may be using updated complier. so that  it may show error.
+1 vote
answered Apr 6, 2018 by (160 points)
#include<stdio.h>
int mul (int a, int b);
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);
}
+1 vote
answered Apr 6, 2018 by anonymous

Use the same argument names while defining the function.

Use  int mul (int a, int b) instead of int mul (int x, int y)

answered Apr 10, 2018 by (140 points)
#include <stdio.h>

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);

return 0;
}
int mul (int x, int y)

{
int p;
p = x*y;
return (p);
}
answered Sep 18, 2018 by anonymous
That´s the code properly running. Cheers

#include <stdio.h>

int mul (int a, int b);
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);
}

you just missed the library "#include <stdio.h>"

commented Sep 19, 2018 by anonymous
TRUE it is must in c language
answered Sep 22, 2018 by (140 points)
#include<stdio.h>
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);
}

USe this is working
answered Sep 22, 2018 by anonymous

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);
}