Skip to content

Instantly share code, notes, and snippets.

@LokeshKumarES
Created September 13, 2018 16:23
Show Gist options
  • Save LokeshKumarES/714d951c3b2c795779acaff4bd72cafa to your computer and use it in GitHub Desktop.
Save LokeshKumarES/714d951c3b2c795779acaff4bd72cafa to your computer and use it in GitHub Desktop.
Write a C program to swap the two numbers.
#include<stdio.h>
#include<conio.h>
void main()
{
int a, b , c;
printf("Enter the value of a: ");
scanf("%d", &a);
printf("Enter the value of b: ");
scanf("%d", &b);
c=a;
a=b;
b=c;
printf("The value of a is: %d\n", a);
printf("The value of b is: %d", b);
getch();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment