AllAlgorithms / c

Implementation of All ▲lgorithms in C Programming Language
https://github.com/AllAlgorithms/c
MIT License
1.44k stars 520 forks source link

Example of c program #406

Open victor48-ux opened 1 year ago

deepak4566 commented 11 months ago

Fixes #406 C program for swapping of two numbers

include

int main() { double first, second, temp; printf("Enter first number: "); scanf("%lf", &first); printf("Enter second number: "); scanf("%lf", &second);

// value of first is assigned to temp temp = first;

// value of second is assigned to first first = second;

// value of temp (initial value of first) is assigned to second second = temp;

// %.2lf displays number up to 2 decimal points

printf("\nAfter swapping, first number = %.2lf\n", first); printf("After swapping, second number = %.2lf", second); return 0; }

deepak4566 commented 11 months ago

This swaps the two numbers

HARSHITHASALADI1 commented 8 months ago

can I work on this issue