c फंक्शन के argument को वैल्यू द्वारा पास करना समझाइये
Answers
Answer:
ifikkjjiknurtfd
Explanation:
Answer:
/* #include<stdio.h> the header file that enables usage of scanf() and printf() functions.*/
#include <stdio.h>
//declaration of function fun()
void fun(int x)
{
//assigning value 30 to variable x but in a different memory location
x = 30;
}
//function declaration closed
//starting main method/function that returns integer value
int main()
{
//assigning value to 20 to variable x.
int x = 20;
/*calling function fun() from main method, after going to function the value of x doesn't change to 30 because in pass by value the values of x=20 and x=30 are stored in different memory locations.*/
fun(x);
/*So when we print the value of x it shows the value 20 which is the actual parameter and value 30 was a formal parameter which doesn't affect the value of x.*/
printf("x = %d", x);
return 0;
}
Explanation:
Hope you understood the concept. Please rate my answer as per your understanding.