write a program to input two numbers. Interchange interchange the numbers using third variable
Answers
Answered by
3
Answer:
Assign var1 value to a temp variable: temp = var1.
Assign var2 value to var1: var1 = var2.
Assign temp value to var2: var2 = temp.
Answered by
1
Answer:
int main()
{
int var1, var2, temp;
printf("Enter two integersn");
scanf("%d%d", &var1, &var2);
printf("Before SwappingnFirst variable = %dnSecond variable = %dn", var1, var2);
temp = var1;
var1 = var2;
var2 = temp;
printf("After SwappingnFirst variable = %dnSecond variable = %dn", var1, var2);
return 0;
}
Explanation:
hope it helps
please mark me brainliest
Similar questions