8.) program of swaping by using function.
// program to swaping using function.
#include <stdio.h>
#include <conio.h>
void swap();
int main()
{
swap();
return 0;
}
void swap()
{
int a, b, s;
printf("Enter a:\n");
scanf("%d", &a);
printf("Enter b:\n");
scanf("%d", &b);
s = a;
a = b;
b = s;
printf("a=%d\n", a);
printf("b=%d\n", b);
}
Output:-
Enter a:
520
Enter b:
365
a=365
b=520
***** Thank you 😃*****
Comments
Post a Comment