Wednesday, June 3, 2020

Pointers-Swapping of 2 numbers in C






#include<stdio.h>
#include<conio.h>
void swap(int*, int*);
void main()
{
int x=10, y =20 ;
printf("Initial number:%d and %d",x,y);
swap(&x,&y);
printf("\n\nfinal number:%d and %d",x,y);
}
void swap(int*p , int*q)
{
int t=0;
t=*p;
*p=*q;
*q=t;
}


Programs:-

For many other Language Programs of microprocessor 8086, C++ , C , Data Structures visit our  BLOG 

There are programs of  Operators (logical, arithmethic ,relational,etc) ,Functions, Pointers ,String operations , Loops , Arrays , etc

No comments:

Post a Comment