Ask Question
23 June, 18:50

Write a program to swap two input integer values without using a temporary variable and display the swapped values. The input values have to be obtained using a scanf statement. (In other words, the entire program must require only these two input values to swap them. A third variables must not be declared or used.) [Hint: Try adding the two input integer values and store it as one of the given input values. From there, you can proceed.]

+2
Answers (1)
  1. 23 June, 21:10
    0
    The program is designed using C programming language

    Explanation:

    #include

    int main () {

    printf ("Enter the first number here ");

    scanf ("%f", num1);

    printf ("Enter the second number here ");

    scanf ("%f", num2);

    num1 = num1 + num2;

    num1 = num2 - num1;

    num2 = num2 - num1;

    printf ("The swapped number num is %f/n", num1);

    printf ("The second swapped is %f", num2);

    return (0);

    }
Know the Answer?
Not Sure About the Answer?
Find an answer to your question ✅ “Write a program to swap two input integer values without using a temporary variable and display the swapped values. The input values have ...” in 📘 Computers and Technology if you're in doubt about the correctness of the answers or there's no answer, then try to use the smart search and find answers to the similar questions.
Search for Other Answers