C Programming  Write a C program to input two nos and swap it.

void main()
{
int a,b,c;
printf("Enter two nos.");
scanf("%d%d",&a,&b);
c=a;
a=b;
b=c;
printf("Swaped value a=%db=%d",a,b);
getch();
}

Input:   10  20
Output  Swaped value a=20 b=10

Related Posts:

  • Control Statement : C Programming C Programming Control Statement The statement which control the flow of control is called control statement.    C Provides following types of control statement- 1. Selective Statement or Conditional Statement. … Read More
  • C Operator : C Programming C Programming C Operators An operator is the symbol that take one or more than one operand and perform operation on it. Ex.   int a,b, c;      a=10,b=20;       c=a+b;&n… Read More
  • FIRST PROGRAM IN C: C PROGRAM   FIRST PROGRAM IN C: C PROGRAM #include<stdio.h> #include<conio.h>    void main() { printf("Welcome to the world of Computer Science.\n"); printf("No Doubt It's field is very big."); getch(… Read More
  • Constants in C : C Programming C Programming Constants in C A constant variable is such type of variable that's value can't be changed during execution of the program. Constants in C ConstantExample Decimal Constant10, 20, 450 etc. Real or Floating-p… Read More
  • Accept Argument And Also Return : C Programming   C Programming                          Accept Argument And Also Return      … Read More