40-Write a program to swap the two numbers using function.
Program: 40
Write a program to swap the two numbers using function.
#include#includeintswap(intx,inty);voidmain(){inta,b;printf("Enter the value of a= ");scanf("%d",&a);printf("Enter the value of b= ");scanf("%d",&b);swap(a,b);getch();}intswap(intx,inty){intt;t=x;x=y;y=t;printf("\n\nThe value of a is %d.\n",x);printf("The value of b is %d.\n",y);}
Lokesh Kumar: Being EASTER SCIENCE's founder, Lokesh Kumar wants to share his knowledge and ideas. His motive is "We assist you to choose the best", He believes in different thinking.
Leave a Comment