Write a program to interchange two variables without using
the third variable?
Answer Posted / neelam
#include<stdio.h>
#include<conio.h>
void main()
{
int a,b;
clrscr();
printf("Enter two no.s 4 swap");
scanf("%d%d",&a,&b);
a=a+b;;
b=a-b;
a=a-b;
printf("After swapping no.s are =\n");
printf("a=%d b=%d",a,b);
getch();
}
Is This Answer Correct ? | 0 Yes | 4 No |
Post New Answer View All Answers
What is the purpose of macro in C language?
What is data types?
What are the different file extensions involved when programming in C?
how to construct a simulator keeping the logical boolean gates in c
a sequence of bytes with one to one corrspondence to those in the external device a) sequential addressing b) address c) byte code d) none
Why is it important to memset a variable, immediately after allocating memory to it ?
a value that does not change during program execution a) variabe b) argument c) parameter d) none
what are the program that using a two dimensional array that list the odd numbers and even numbers separately in a given 10 inputs values
What is typedf?
What is structure padding and packing in c?
Differentiate between declaring a variable and defining a variable?
What do you mean by dynamic memory allocation in c?
What is the sizeof () a pointer?
What is indirection in c?
Describe how arrays can be passed to a user defined function