C Program to Swap (interchange) the Two Numbers with using Third variable|E-studyblog

 C  Program to Swap (interchange) the Two Numbers with using Third variable|E-studyblog

C  Program to Swap (interchange) the Two Numbers with using Third variable

C  Program to Swap (interchange) the Two Numbers with using Third variable|


#include <stdio.h>
int main(){
	double a,b,temp;
	printf("\nEnter first number:");
	scanf("%lf",&a);
	printf("\nEnter the second number");
	scanf("%lf",&b);
	//value of first(a) is assigned to temp
	temp=a;
	//value of second (b)is assigned to first(a)
	a=b;
	//initial value of temp is assigned to second (b)
	b=temp;
	
	printf("\n Swapping of first numbers=%.2lf\n",a);
	printf("\n Swapping of second numbers=%.2lf\n",b);
	
	return 0;	
}



Output:

C  Program to Swap (interchange) the Two Numbers with using Third variable|

I hope you have read our Article "C  Program to Swap (interchange) the Two Numbers with using Third variable|E-studyblog"  and  you have collected lots of information from there.If you like the post,then please comment and share among your friends and family. you can write your opinion about my post in the comment box. 


Thank you!

No comments:

Post a Comment

If you have any queries ,please let us know

C Program to Check whether the number is Even or Odd|how to find odd and even numbers in c programming|E-studyblog

I n this Article, you will learn how to   Check  whether the number is  Even or odd. We have shared the source code of odd and even number i...