google.com, pub-8786015629279405, DIRECT, f08c47fec0942fa0 Write a Program for call by value in C

Write a Program for call by value in C

0



// Write a Program for call by value
#include <stdio.h>
#include<conio.h>

// Function Prototype
void swapx(int x, int y);

// Main function
void main()
{
int a,b;
// Actual Value
printf(“Please Enter The Value of A & B\n”);
scanf(“%d%d”,&a,&b);
printf(“The Actual value of a=%d & b=%d\n”,a,b);
// Pass by Values
swapx(a, b);
printf("The Actual Value of A & B after swapping a=%d &  b=%d\n", a, b);
}
 
// Swap functions that swaps
// two values
void swapx(int x, int y)
{
 int t;

 t = x;
 x = y;
 y = t;
printf("The Value after swapping x=%d &  y=%d\n", x, y);
}


Post a Comment

0 Comments
* Please Don't Spam Here. All the Comments are Reviewed by Admin.

Thank you for your interest 😊

We will back shortly after reviewing...

Thank you for your interest 😊

We will back shortly after reviewing...

Post a Comment (0)

#buttons=(Accept !) #days=(20)

Our website uses cookies to enhance your experience. Learn More
Accept !
To Top