google.com, pub-4617457846989927, DIRECT, f08c47fec0942fa0 Learn to enjoy every minute of your life.Only I can change my life.: C program to swap the values of two variables by using call by reference using pointer.

Wednesday, April 1, 2015

C program to swap the values of two variables by using call by reference using pointer.

Write a ‘C’ program to swap the values of two variables by using call by reference using pointer.

#include<stdio.h>
#include<conio.h>
void swap(int *,int *);
void main()
{
int a,b;
clrscr();
printf("\nENTER THE VALUE FOR A & B");
scanf("%d%d",&a,&b);
printf("\n\nVALUES BEFORE SWAPPING \n");
printf("%d\t%d",a,b);
swap(&a,&b);
getch();
}
void swap(int *x,int *y)
{
int t;
{
t=*x;
*x=*y;
*y=t;
}
printf("\n\nVALUES AFTER SWAPPING \n");
printf("%d\t%d",*x,*y);
}

रामायण

रामायण दशरथ की तीन पत्नियाँ – कौशल्या, सुमित्रा , कैकेयी दशरथ के चार पुत्र – राम,लक्ष्मण,भरत,शत्रुघ्न दशरथ: राम के पिता और कौशल के राजा कौशल...