Passing Values Homework Help
So far the Functions we have discussed are Void Type. These Functions just display a message. Sometimes, we pass some values to the Function as argument and it returns a value which is used by the main or any other Function.
The following example will illustrate this:
{`#include <stdio.h> #include <conio.h> int add(int x, int y); int sub(int x, int y); int mult(int x, int y); void main() { //int a, b, result; printf("Enter two integers: "); scanf("%d %d",&a,&b); result = add(a,b); printf("\nThe sum of two numbers is : %d",result); result = sub(a,b); printf("\nThe difference of two numbers is : %d",result); result = mult(a,b); printf("\nThe product of two numbers is : %d",result); getch(); } int add(int x, int y) { int result ; result = x + y ; return result ; } int sub(int x, int y) { int result ; result = x - y ; return result ; } int mult(int x, int y) { int result ; result = x * y ;< return result ; }`}

Topics in C Programming
Resources
24 x 7 Availability.
Trained and Certified Experts.
Deadline Guaranteed.
Plagiarism Free.
Privacy Guaranteed.
Free download.
Online help for all project.
Testimonial
Urgenthomework helped me with finance homework problems and taught math portion of my course as well. Initially, I used a tutor that taught me math course I felt that as if I was not getting the help I needed. With the help of Urgenthomework, I got precisely where I was weak: