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 |
Write a C program to multiply tho numbers without using arithmetic operator (+, -, *, /).
What are dangling pointers?
what is the output for the code : main() { int i,j; printf("%d %d ",scanf("%d%d",&i,&j)); }
Badboy is defined who has ALL the following properties: Does not have a girlfriend and is not married. He is not more than 23 years old. The middle name should be "Singh" The last name should have more than 4 characters. The character 'a' should appear in the last name at least two times. The name of one of his brothers should be "Ram" Write a method: boolean isBadBoy(boolean hasGirlFriend , boolean isMarried, int age , String middleName , String lastName , String[] brotherName); isHaveGirlFriend is true if the person has a girlfriend isMarried is true if the person is married age is the age of the person middleName is the middle name of the person lastName is the last name of the person brotherName is the array of the names of his brothers
write a “Hello World” program in “c” without using a semicolon?
What is the value of uninitialized variable in c?
What is the difference between static and global variables?
Explain how can I right-justify a string?
How do you define CONSTANT in C?
what is the use of keyword volatile??
how can write all 1to 100 prime numbers using for loop,if and break ?
Why is conio.h not required when we save a file as .c and use clrscr() or getch() ?