Skip to content

Punitcool/C-Program-to-Swap-Two-Numbers

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 

Repository files navigation

C-Program-to-Swap-Two-Numbers

#include <stdio.h>

// Driver code int main() { int x, y; printf("Enter Value of x "); scanf("%d", &x); printf("\nEnter Value of y "); scanf("%d", &y);

// Using a temporary variable to swap the values
// Store the value of x in a temporary variable
int temp = x;
// Assign the value of y to x
x = y;
// Assign the value stored in the temporary variable to
// y
y = temp;

printf("\nAfter Swapping: x = %d, y = %d", x, y);
return 0;

}

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published