write a program in C to swap two variables

Answer Posted / r.aruna

#include<stdio.h>
#include<conio.h>
void main()
{
int a,b,c;
clrscr();
printf("Enter the a value");
scanf("%d",&a);
printf("Enter the b value");
scanf("%d",&b);
a=a+b;
b=a-b;
a=a-b;
printf("After swapping a,b value",a,b);
getch();
}

Is This Answer Correct ?    11 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain what are the standard predefined macros?

855


What are the disadvantages of external storage class?

792


Why do we use static in c?

812


What is a union?

789


why wipro wase

2035


What is the purpose of realloc()?

872


What is the main difference between calloc () and malloc ()?

816


What is the usage of the pointer in c?

814


What’s the special use of UNIONS?

863


Write a programme using structure that create a record of students. The user allow to add a record and delete a record and also show the records in ascending order.

1843


what is a function method?give example?

2108


All technical questions

1726


What is const keyword in c?

935


find out largest elemant of diagonalmatrix

1864


Explain threaded binary trees?

891