swapping of two numbers without using third variable using
AND and OR operators
Answers were Sorted based on User's Feedback
Answer / ramesh reddy
a = a^b; b =a^b; a =a^b;
or
a=a+b; b=a-b; a=a-b;
Is This Answer Correct ? | 43 Yes | 2 No |
however we can implement using EXoR , where it is made of
AND and OR gate too....
x=90;
y=51;
x^=y^=x;
the value of x & y will be swapped.
Is This Answer Correct ? | 8 Yes | 8 No |
what is the output of the following program and explain the answer #include<stdio.h> exp() { main(5) } main(int a) { printf("%d",a); return; }
without using arithmatic operator solve which number is greater??????????
Without using main fn and semicolon,print remainder for a given number in C language
What is data type long in c?
What are qualifiers?
name the language for writing c compiler?
Why is malloc used?
FORMATTED INPUT/OUTPUT functions are a) scanf() and printf() b) gets() and puts() c) getchar() and putchar() d) all the above
Explain c preprocessor?
#include<stdio.h> int main() { int a[3][3][2]= {1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18}; printf("%d\n",*(*(*a+1)); return 0; } What will be the output of the above question? And how?
What is the difference between declaring a variable and defining a variable?
write a program that will open the file, count the number of occurences of each word in the the complete works of shakespeare. You will then tabulate this information in another file.