With argument with return type(WAWR):
A “with argument, with return type” function is a type of function in programming that takes one or more arguments as input and returns a value upon execution.
Here’s the definition syntax for a with argument, with return type function in C:
return_type function_name(data_type parameter1, data_type parameter2, …) { // Function body – code block where the functionality of the function is defined // You can perform operations, calculations, etc. here using the parameters // Return statement – specifies the value to be returned by the function return value; }
Example:
//ADDITION OF RWO NUMBER BY USING –
//WITH ARGUMENT WITH RETURN TYPE(wAWR)
#include<stdio.h>
int add(int a,int b)
{
int sum;
sum=a+b;
return sum;
}
int main()
{
int result;
result=add(10,20);
printf(“%d”,result);
return 0;
}
OUTPUT:-
30