Function Call by Passing Value in C Programming

When a function is called by passing value of variables then that function is known as ‘function call by passing values’.
Syntax:

// Declaration
void <function_name>(<data_type><var_nm>);

// Calls
<function_name>(<var_nm>);

// Definition
void <function_name>(<data_type><var_nm>)
{
	<function_body>;
	- - - - - - - -;
}

Program :

/*  Program to demonstrate function call by passing value.
Creation Date : 24 Nov 2010 12:08:26 AM
Author : www.technoexam.com [Technowell, Sangli] */

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

void printno(int a)
{
	printf("\n Number is : %d", a);
}
int main(void)
{
	int no;
	void printno(int);
	clrscr();
	printf("\n Enter Number : ");
	scanf("%d", &no);
	printno(no);
	getch();
	return 0;
}

Output :


 Enter Number : 21
 
 Number is : 21_

Leave A Comment

Your email address will not be published. Required fields are marked *