Write a program to interchange two variables without using
the third variable?
Answer Posted / genius
#include <stdio.h>
#include <conio.h>
main()
{
int a,b,temp;
clrscr();
printf("enter two numbers:");
scanf("%d,%d",&a,&b);
printf("values of a and b are %d,%d \n",a,b);
temp=a;
a=b;
b=temp;
printf("swapped values of a and b are %d,%d", a,b);
getch();
}
| Is This Answer Correct ? | 4 Yes | 6 No |
Post New Answer View All Answers
Explain the difference between malloc() and calloc() in c?
Why functions are used in c?
Explain output of printf("Hello World"-'A'+'B'); ?
An arrangement of information in memory in such a way that it can be easily accessed and processed by a programming language a) string b) data structure c) pointers d) array
Explain what are the different data types in c?
int i[2], j; int *pi;i[0] = 1; i[1] = 5; pi = i; j = *pi + 1 + *(pi + 1)Value of j after execution of the above statements will be a) 7 b) 6 c) 4 d) pointer
What is a stream water?
Which is best book for data structures in c?
Should I use symbolic names like true and false for boolean constants, or plain 1 and 0?
What is logical error?
Why cant I open a file by its explicit path?
Differentiate abs() function from fabs() function.
Differentiate between ordinary variable and pointer in c.
What's the total generic pointer type?
can any one please explain, how can i access hard disk(physical address)? it is possible by the use of far,near or huge pointer? if yes then please explain......