Computer Science, asked by prajnad2006, 6 months ago

write a program to interchange the values of two variables without using third variable using arithmetic operators

Answers

Answered by srini65
3

Answer:

hi this is the answer okay make me as brainalist

Explanation:

Method 1: Using Arithmetic operators + and -

#include<stdio.h>

int main()

{

int a, b;

printf("Enter two numbers: ");

scanf("%d %d", &a, &b); //consider two numbers as 4 and 5.

a = a + b; //a = 4 + 5 = 9.

b = a - b; //b = 9 - 5 = 4.

good night sweet dreams

purple u always

Similar questions