ads

Sunday, 28 August 2016

C PROGRAM FOR SWAPPING OF TWO NUMBERS

#include<stdio.h>
#include<conio.h>
void main()
{
  int a,b,temp;
  printf("enter the values of a and b:");
  scanf("%d%d",&a,&b);
  printf("values of a and b before swapping :%d%d",a,b);
  temp=a;
  a=b;
  b=temp;
  printf("values of a and b after swapping are :%d%d",a,b);
  getch();
}

No comments:

Post a Comment