I am writing a program for "swap" using pointers that accepts the values of two variables and write a function in which we take two integers and then display them by swapping the values. Here's the solution, but I can not compile
Code:/*Swap*/ #include<stdio.h>; #include<conio.h>; void swap (int *x,int *y){ int val; val=*x; *x=*y; *y=val; } void main(){ int a;int b; clrscr(); scanf("%d%d,&a,&b); swap(a,b); printf("a=%d,b=%d",a,b); do{} while(kbhit()==0); }


Reply With Quote

Bookmarks