SWAP THE VALUES OF TWO VARIABLES BY USING CALL BY REFERENCE


#include<stdio.h>
#include<conio.h>
int swaping(int*n1, int*n2);
void main()
  {
    int num1, num2;
    clrscr();
    printf("\n Enter any Two Integer Number \n ");
    scanf("%d%d ", &num1,&num2);
    printf("\n Before swaping\n");
    printf("\n Num1=%d and Num2%d", num1, num2);
    swaping(&num1, &num2);
    printf("\n After swaping\n");
    printf("\n Num1=%d Num2=%d ", num1, num2);
    getch();
  }
   int swaping(int*n1, int*n2)
  {
   int temp;
    temp=*n1;
   *n1=*n2;
    *n2=temp;
      getch();
   }

1 comments: (+add yours?)

zas8k9lxzj said...

This one gets our vote for top-of-the-line 3D printer designs in this record. Designed with bigger books in thoughts, this tool is delightfully useful. Nearly everyone these days has a smartphone, and we’ve probably all had moments the place we wished to prop up our telephones for viewing video or photographs and needed to resort to piled books or whatever else is on hand. That makes this tiny project one of the coolest 3D printed objects duvet cover on the record.

Post a Comment