Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR C

c program for swapping of two numbers

// Overcomplicating things lol. Try this
#include <stdio.h>
int main()
{
    int x, y;
    printf("Enter Value of x ");
    scanf("%d", &x);
    printf("
Enter Value of y ");
    scanf("%d", &y);
    int temp = x;
    x = y;
    y = temp;
    printf("
After Swapping: x = %d, y = %d", x, y);
    return 0;
}
Source by devsenv.com #
 
PREVIOUS NEXT
Tagged: #program #swapping #numbers
ADD COMMENT
Topic
Name
8+7 =