write a program to swap Two numbers without using temp variable.

Answer Posted / prudhvi

int a, b, c;
a = int.Parse(Console.ReadLine());
b = int.Parse(Console.ReadLine());
c = b;
b = a;
a = c;
Console.WriteLine("a={0},b={1}",a,b);
Console.ReadLine();




}

Is This Answer Correct ?    0 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain how can I manipulate strings of multibyte characters?

969


What is #line?

806


What is the purpose of & in scanf?

815


What does the c preprocessor do?

833


What is queue in c?

741


Explain Function Pointer?

878


Why void main is used in c?

767


What type is sizeof?

780


how to find binary of number?

3882


What is hash table in c?

760


write a program to print data of 5 five students with structures?

1817


What is a nested formula?

773


Study the following C program :call_me (myvar)int myvar;{ myvar +- 5; }main(){int myvar;myvar = 3;call_me(myvar);printf("%d ",myvar);What will be printed a) 3 b) 5 c) 8 d) symbol

893


Explain why can’t constant values be used to define an array’s initial size?

1073


regarding pointers concept

1791