Write a program to interchange two variables without using
the third variable?
Answer Posted / debasis nayak
#include<stdio.h>
#include<conio.h>
void main()
{
int a,b;
clrscr();
printf("Enter the value of A and B");
scanf("%d %d",&a,&b);
b=(a+b-a=b);
printf("After interchange value are %d %d",a,b);
getch();
}
Is This Answer Correct ? | 11 Yes | 13 No |
Post New Answer View All Answers
What is function pointer c?
void main(int n) { if(n==0) return; main(--n); printf("%d ",n); getch(); } how it work and what will be its output...............it any one know ans plz reply
A character flag or control mechanism that delineates one data item from another a) variable b) constant c) delimiter d) call by reference
Do you know the difference between malloc() and calloc() function?
What is merge sort in c?
Why c is called free form language?
Compare array data type to pointer data type
What are the different types of control structures?
What is data structure in c language?
What is meant by preprocessor in c?
code for replace tabs with equivalent number of blanks
What extern c means?
What is the collection of communication lines and routers called?
What do header files do?
Given only putchar (no sprintf, itoa, etc.) write a routine putlong that prints out an unsigned long in decimal. [ I gave the obvious solution of taking % 10 and / 10, which gives us the decimal value in reverse order. This requires an array since we need to print it out in the correct order. The interviewer wasn't too pleased and asked me to give a solution which didn't need the array ].