Ask Question
21 June, 05:28

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.]

+5
Answers (1)
  1. 21 June, 05:39
    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?
Get 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 & Technology if there is no answer or all answers are wrong, use a search bar and try to find the answer among similar questions.
Search for Other Answers