Write a program to interchange two variables without using
the third variable?

Answer Posted / jisha. k.a

#include<stdio.h>
#include<conio.h>
void main()
{
int a,b;
clrscr();
printf("Enter two no");
scanf("%d%d",&a,&b);
a=a-b;
b=a+b;
a=b-a;
printf("After chanching no is =\n");
printf("a=%d b=%d",a,b);
getch();
}

Is This Answer Correct ?    34 Yes 16 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How to write c functions that modify head pointer of a linked list?

532


Write the program that calculates and prints the average of several integers. Assume that the last value read is sentinel 9999.

3104


Do you know what are the properties of union in c?

569


Is that possible to add pointers to each other?

883


write a progrmm in c language take user interface generate table using for loop?

1563






How can type-insensitive macros be created?

685


Why string is used in c?

569


Are there constructors in c?

582


What is the size of structure in c?

689


What are run-time errors?

589


What are the output(s) for the following ? #include char *f() {char *s=malloc(8); strcpy(s,"goodbye")} main() { char *f(); printf("%c",*f()='A'); }

685


What does %2f mean in c?

668


What does the error 'Null Pointer Assignment' mean and what causes this error?

731


#define f(g,h) g##h main O int i=0 int var=100 ; print f ("%d"f(var,10));} wat would be the output??

1530


What is function what are the types of function?

549