write a program to swap two numbers without using temporary
variable?
Answer Posted / sam
let a and b be variables
a^=b^=a^=b;
by performing this logic from right hand side we can swap
two variables
| Is This Answer Correct ? | 6 Yes | 5 No |
Post New Answer View All Answers
What is wild pointer in c with example?
find the output? void r(int a[],int c, int n) { if(c>n) { a[c]=a[c]+c; r(a,++c,n); r(a,++c,n); } } int main() { int i,a[5]={0}; r(a,0,5); for(i=0;i<5;i++) printf("\n %d",a[i]); getch(); }
Write a program to check whether a number is prime or not using c?
Where are local variables stored in c?
When we use void main and int main?
which of the following is not a character constant a) 'thank you' b) 'enter values of p, n ,r' c) '23.56E-o3' d) all of the above
How are variables declared in c?
What does static variable mean in c?
Are local variables initialized to zero by default in c?
What is the use of sizeof?
What are the types of data structures in c?
What is the g value paradox?
What do you mean by a sequential access file?
What is omp_num_threads?
How can I dynamically allocate arrays?