Skip to content

apc-sps-002.c

Problem Statement

WAP to swap two integers. Display both numbers before and after swap

Metadata

Property Detail
Author Amit Dutta (amitdutta4255@gmail.com)
License MIT

Actions

Raw View on GitHub

💡 You can print or save this file by opening Raw and using your browser.

Source Code

#include<stdio.h>
int main() {
    int a = 10, b = 20, temp;
    printf("Before swap A : %d, B : %d", a, b);
    temp = a;
    a = b;
    b = temp;
    printf("\nAfter swap A : %d, B : %d", a, b);
    return 0;
}