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

Answer Posted / manas ranjan(gift)

#include<stdio.h>
void main()
{
int a,b;
printf("enter the numbers");
scanf("%d%d",&a,&b);
printf("before swaping the values are");
printf("a=%d,b=%d",a,b);
void swap(int,int);
swap(a,b);
}
void swap(int a,int b)
{
a=a+b;
b=a-b;
a=a-b;
printf("a=%d,b=%d",a,b);
}

Is This Answer Correct ?    0 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Write a C/C++ program that connects to a MySQL server and checks if the InnoDB plug-in is installed on it. If so, your program should print the maximum number of concurrent threads that the InnoDB plug-in can create.

1696


Explain what could possibly be the problem if a valid function name such as tolower() is being reported by the c compiler as undefined?

793


What is a structure in c language. how to initialise a structure in c?

819


Explain how can I open a file so that other programs can update it at the same time?

855


What is struct node in c?

799


What happens if a header file is included twice?

779


What is property type c?

829


code for find determinent of amatrix

1723


Was 2000 a leap year?

822


What is an auto keyword in c?

854


Is c still used?

786


Why we use void main in c?

822


What are the types of assignment statements?

820


What is %d used for?

767


When should you not use a type cast?

881