Swapping Operation using third variable :-
QUESTION: Swapping operation using third variable (temp)
#include <stdio.h>
int main ()
{
int a, b, temp;//a=10,b=20
printf ("enter the value of a &b "); // to print the output
scanf ("%d%d",&a,&b); // to take the input from the user
temp=a; //temp=10
a=b; //10=20
b=temp; //b=10, now a=30-b=30-10=20
printf ("after swapping a =%d and after swapping b=%d \n",a,b);
return 0;
}
INPUT :
---THANK YOU FOR VISITING THIS PAGE
I want more like this kind of coding
ReplyDeleteThank you,keep supporting
DeleteNice 👍
ReplyDeleteThank you,keep supporting
DeleteGood job, Carry on, waiting for your next post.
ReplyDeletethank you ..keep supporting
Delete