swap two number wthout using third variable
Answers were Sorted based on User's Feedback
Answer / jvhariharan
void main()
{
int a=10,b=20;
a=a+b;
b=a-b;
a=a-b;
}
| Is This Answer Correct ? | 24 Yes | 3 No |
Answer / ashutosh tiwari
void swap_num(int *a, int *b)
{
*a = *a+*b; *b = *a-*b; *a = *a-*b;
}
or
void swap_num(int *a,int *b)
{
*a = *a^*b; *b = *a^*b; *a = *a^*b;
}
| Is This Answer Correct ? | 8 Yes | 0 No |
Answer / suyog
A very simple and cute answer...
Assign as follows
a=a+b-(b=a)
| Is This Answer Correct ? | 6 Yes | 0 No |
Answer / abhay khare
void main()
{
int a,b,c
printf("two no are\n");
scanf("%d&n");
a=c;
b=a
c=b
getch;
}
| Is This Answer Correct ? | 1 Yes | 10 No |
what are the difference between C,C++and Java
Explain the types of operations? Draw the figure for shift and rotate operations?
why we use new keyword for object
What is nocopy in plsql?
HOW TO BREAK THE FIREWALL?
hi This is radhika.Can anyone help me to know the question papers of NATIONAL INFORMATICS CENTRE for the post of scientific officer/engineer? if anyone know plz tell me question paper pattern
Please anyone tell me coding to print prime numbers from 1 to 5000 in c#....
When you deliver your C++ headers and C++ library of a class (what all can you change in the class so that application using your class does not need to recompile the code)
what is throws keyword
Write a program which inputs 2 integers representing the sides of a triangle, a and b. Next, write a function which accepts the 2 sides as parameters and returns the hypotenuse of the triangle, c. Use c 2 = a 2 + b 2 To raise a number to an exponent, us e the built - in JavaScript function Math.pow() Let’s say you have a variable x and you want to raise it to the 5 th power, use Math.pow in the following manner... Math.pow( x, 5 ); This will raise x to the 5 th power. To find the square root of a number, use t he built - in JavaScript function Math.sqrt () So to find the square root of x, use Math.pow () in the following manner... Math.sqrt( x ) You must create 2 functions to receive credit for this assignment. Your ‘ main ’ function which is called from the button. And your hypotenuse function. Again, the main function calls upon the hypotenuse f unction when it needs that value. Get the user ’ s input, call the function, output your result. Create your own CSS layout
through which algorithm does the garbage collector works? how the garbage collector will understand that the object will going to be deleted?
Info for guidewire documents and interview questions