write a prgram of swapping with 2 valiables

Answer Posted / vijay r15

#include<stdio.h>
Void main()
{
int a=10,b=20;
a=a+b-(a=b);
// or use temp var
//or use a^=b^=a
//or use a=a+b;b=a-b;a=a-b;
printf("%d%d",a,b);
}

Any dbt mail to raj.vijay55@gmail.com

Is This Answer Correct ?    3 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Can we use visual studio for c?

646


What should malloc() do?

736


What is break in c?

695


What is define c?

673


What are c identifiers?

724






If I have a char * variable pointing to the name of a function ..

763


What is meant by operator precedence?

771


What are the three constants used in c?

639


Write a C++ program to generate 10 integer numbers between - 1000 and 1000, then store the summation of the odd positive numbers in variable call it sum_pos, then find the maximum digit in this variable regardless of its digits length.

1661


Place the #include statement must be written in the program?

656


What is #pragma statements?

687


What is merge sort in c?

726


how do you execute a c program in unix.

727


What is the difference between formatted&unformatted i/o functions?

713


What is function in c with example?

731