Swaping numbers using pointers

Problem statement
Write a c program to Swap the values of two numbers using pointer
#include<stdio.h>
int main()
{
  int *a,*b,*c,*temp;
  printf("enter tha a \n");
  scanf("%d",a);
  printf("enter b \n");
  scanf("%d",b);
  printf("enter c \n");
  scanf("%d",c);
  printf("a,b,c are %d,%d,%d \n",*a,*b,*c);
return 0;
}

No comments:

Post a Comment