PROGRAM TO SWAP TWO NUMBERS USING POINTERS

No comments

/*PROGRAM TO SWAP TWO NUMBERS USING POINTERS*/


#include <stdio.h>

int main()
{
   int x, y, *a, *b, temp;
printf("Enter the value of x and y\n");
   scanf("%d%d", &x, &y);
printf("Before Swapping\nx = %d\ny = %d\n", x, y);
   a = &x;
   b = &y;
  temp = *b;
   *b   = *a;
   *a   = temp;
  printf("After Swapping\nx = %d\ny = %d\n", x, y);
     return 0;
}


OUTPUT :-


c program to swap two numbers,swap two numbers,c programming,pointer in c,how to swap in c using pointers,swap two numbers without using three variables,how to swap two numbers in c programming,swap two numbers in c,c (programming language),c program to add two numbers using pointers in hindi,programming in c,c program to add two numbers using pointers,how to swap two numbers

No comments :

Post a Comment

Subscribe

Milan Panda
Admin
About Me | Contact
Copyright 2023-2024 © Programming1011 . 🎀 Developed and Design By- Milan Panda. Happy Holi All Of You 🎀