Swap two number with customer choice

 Swap two number with customer choice in C language.

#include<stdio.h>

void swap(int,int);

int main() 

{

    int a,b;

      printf("Enter first number: ");

      scanf("%d", &a);

      printf("Enter second number: ");

      scanf("%d", &b);

      swap(a,b);

}

void swap(a,b)

{

      int temp = a;

      a = b;

      b = temp;

      printf("After swapping, firstNumber = %d\n", a);

      printf("After swapping, secondNumber = %d", b);

}


Output program




Thank You.

Comments

Popular posts from this blog

Write a program to calculate the bill amount for an item given its quantity sold, value, discount ,and tax.

Bank Atm project using C Programming

Indian Flag INDEPENDENCE DAY SPECIAL CODING