Write a program to interchange two variables without using
the third variable?
Answer Posted / guest
#include<stdio.h>
void main()
{
int x,y;
printf("enter x and y");
scanf("%d%d",&x,&y);
x=x+y;
y=x-y;
x=x-y;
printf("elements after swapping :%d,%d",x,y);
}
| Is This Answer Correct ? | 185 Yes | 32 No |
Post New Answer View All Answers
Is swift based on c?
What are the different types of objects used in c?
An integer that indentifies the position of a data item in a sequence of data items a) value b) number c) index d) all of the above
Explain what is wrong in this statement?
while initialization of array why we use a[][2] why not a[2][]...?
What is the g value paradox?
What is meant by recursion?
what is the c source code for the below output? 10 10 10 10 10 10 10 10 10 10 9 9 7 6 6 6 6 6 6 9 7 5 9 7 3 2 2 5 9 7 3 1 5 9 7 3 5 9 7 4 4 4 4 5 9 7 8 8 8 8 8 8 8 8 9
What is the concatenation operator?
4-Take two sets of 5 numbers from user in two arrays. Sort array 1 in ascending and array 2 in descending order. Perform sorting by passing array to a function mySort(array, sortingOrder). Then multiply both the arrays returned from function, using metric multiplication technique in main. Print result in metric format.
How do I send escape sequences to control a terminal or other device?
How can I invoke another program (a standalone executable, or an operating system command) from within a c program?
write a c program to print the next of a particular no without using the arithmetic operator or looping statements?
Which type of language is c?
How to compare array with pointer in c?