This C program demonstrates call by value by passing the values of two integers, a and b, into a swap function. The swap function swaps the values of the parameters a and b by using a temporary variable, but this does not affect the original values of a and b in main, since call by value was used. The original values of a and b in main are printed as 100 and 200.
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0 ratings0% found this document useful (0 votes)
31 views2 pages
Call by Value Program
This C program demonstrates call by value by passing the values of two integers, a and b, into a swap function. The swap function swaps the values of the parameters a and b by using a temporary variable, but this does not affect the original values of a and b in main, since call by value was used. The original values of a and b in main are printed as 100 and 200.