Topic-22: WANR

With argument no return type(WANR):

A “with argument, no return type” function is a type of function in programming that takes one or more arguments as input but does not return any value upon execution.

Here’s the definition syntax for a with argument, no return type function in C:

void 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 // This function does not return any value }

Example:

//ADDITION OF RWO NUMBER BY USING –

//WITH ARGUMENT NO RETURN TYPE(WANR)

#include<stdio.h>

void add(int a , int b)

{

int sum;

sum=a+b;

    printf(“%d”,sum);

}

int main()

{

add(10,20);

return 0;

}

OUTPUT:-

30

Leave a Comment

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