AnkitWebLogic

C - Swap value

Q11. WAP to Input two numbers and swap them. 1

#include<stdio.h>
void main()
{
	int a, b, c;
    printf("\nEnter two numbers:");
    scanf("%d%d",&a,&b);
    c=a;
    a=b;
    b=c;
    printf("A = %d\n",a);
    printf("B = %d",b);
}
Enter two numbers: 10
20
A = 20
B = 10

Advertisement