Pergunta de entrevista da empresa Cvent

Swap two integers without using any extra memory.

Respostas da entrevista

Sigiloso

29 de ago. de 2017

Take 2 variable a and b Then take values from user or you can give values to a and b like a=20 b=30 Then a=a+b b=a-b a=a-b Now a=30 b=20

Sigiloso

13 de set. de 2017

Take two variables a and b than take two values from user or we can also give the values of these like , a = 10; b = 20; then a = a * b; b = a / b; a = a/ b; Now the output is a = 20; b = 10;