The answer for your C programming exercise is given below.


#include <stdio.h>
void Swap(int *,int *);
void main()
{
    int num1 = 10, num2 = 20, res;
    printf("Before swap %d,%d,num2",num1,num2);
    res = Swap(&num1,&num2);
    printf("After swap %d,%d",num1,num2);
}
void Swap(int *a,int *b)
{
    int temp;
    temp = *a;
    *a = *b;
    *b = temp;
}



To Watch Video Explanations

You need to subscribe & logged in

Subscribe