jituTechnology

jituTechnology

A program to swap the two integer variable using call by value.

A program to swap the two integer variable using call by value.

Codes
/*A program to find the factorial of a number using recursive function*/
/*Programed by          Jitendra Kr Yadav
                         10116
                         15 Mar,2011*/
#include<stdio.h>
#include<conio.h>
void swap(int,int);
main()
{
int a,b;
printf(“Enter the value of ‘a’ and ‘b’:\n”);
scanf(“%d%d”,&a,&b);
swap(a,b);
getch();
}
void swap(int x,int y)
{
int temp;
temp=x;
x=y;
y=temp;
printf(“a = %d\n”,x);
printf(“b = %d\n\n”,y);
printf(“Press any key to continue…”);
}
Output
Enter the value of ‘a’ and ‘b’:
6
5
a = 5
b = 6

Press any key to continue…

No comments yet.

Add a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.



Connect with Me

GPO 8973 NPC 541; Kathmandu Nepal
Phone: +977 9851236800

Calendar

March 2024
S M T W T F S
 12
3456789
10111213141516
17181920212223
24252627282930
31