➽ Program:-
#include<stdio.h>
int main()
{
double num1,
num2, temp;
printf("Enter
first number: ");
scanf("%lf",
&num1);
printf("Enter
second number: ");
scanf("%lf",
&num2);
temp = num1;
num1 = num2;
num2 = temp;
printf("After
swapping, firstNumber = %.2lf\n", num1);
printf("After
swapping, secondNumber = %.2lf", num2);
return 0;
}
➽ Output:-
Enter first number: 7.8
Enter second number: 12.6
After swapping, firstNumber = 12.60
After swapping, secondNumber = 7.80
0 Comments
Please do not enter any spam link in the comment section.