Programming

Function Passing Arguments and Returning No Value

This C program describes how to write a code for function passing arguments and returning no value.

#include <stdio.h>
#include <conio.h>

void sum (int, int);

void main()
{
int a,b;
printf("enter two numbers :");
scanf("%d%d",&a,&b);
sum(a,b);
getch();
}
void sum(int s, int t){
int add;

add = s+t;

printf("n The sum of the two numbers is : %d", add);

}

Output

Function Passing Arguments and Returning no Value

Tuts

About Author

Tutsmaster.org provides tutorials related to tech and programmings. We are also setting up a community for the users and students.