C program to swap two numbers using a third variable
belongs to collection: C programs - Basic C Programs
All Answers
total answers (1)
Severity: 8192
Message: str_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated
Filename: libraries/Filtered_db.php
Line Number: 23
belongs to collection: C programs - Basic C Programs
total answers (1)
C program to swap two numbers using a third variable - Source code
Program Output
Program Explanation
1. In the above program, first, the temp variable is assigned the value of first number a.
2. Then, the value of first number a is assigned to second number(b).
3. Finally, the temp variable (which holds the initial value of a) is assigned to variable b, which completes the swapping process.
4. Note that, here, temp variable is used to hold the value of first variable a and doesn't have any other use except that.
need an explanation for this answer? contact us directly to get an explanation for this answer