I have tried different ways to add a new function or change setting for this cod
ID: 3786613 • Letter: I
Question
I have tried different ways to add a new function or change setting for this coding scenarios but keep getting errors. I have done a program before. I need help to fix my coding, understand what I can do to add function to this example problem and how go by it?
This exercise example
Question: Type the below code in Visual Studio and run it. Describe what is happening here. Now, add a new function in this program. Perhaps you want to subtract the two numbers or multiply them or find the greater or lesser than values. Make sure to upload your code and that it contains the original add function as well as the one you created.
This my work for the practice problem
#includeExplanation / Answer
#include <stdio.h>
int add(int x,int y);
int mul(int x,int y);
int main()
{
int a,b;
int sum,multi;
printf("Enter the first number:");
scanf("%d",&a);
printf("Enter the second number:");
scanf("%d",&b);
sum = add(a,b);
printf("the sum of the two numbers is : %d ",sum);
multi = mul(a,b);
printf("the multiplication of the two numbers is : %d ",multi);
return 0;
}
int add(int x,int y)
{
return x+y;
}
int mul(int x,int y)
{
return x*y;
}