void swap(int a,int b)
{
a=a+b;
b=a-b;
a=a-b;
}
in this code always gives the same result for all case
Answer Posted / prateek
Actually this code is for interchanging values of two
variables without using third variable
| Is This Answer Correct ? | 9 Yes | 1 No |
Post New Answer View All Answers
Write a program to swap two numbers without using third variable in c?
any function have arguments one or more OR not . it is compulsary a) any function compulsary have one or more arguments b) any function did not have arguments. It is not compulsary c) it is optional it is not compulsary d) none of the above
Why main function is special give two reasons?
Lists the benefits of c programming language?
Why doesn't C support function overloading?
.main() { char *p = "hello world!"; p[0] = 'H'; printf("%s",p); }
Why c language?
Write a program to use switch statement.
What is structure padding in c?
What is scope and lifetime of a variable in c?
Why clrscr is used after variable declaration?
write a program that declares an array of 30 elements named "income" in the main functions. then cal and pass the array to a programmer-defined function named "getIncome" within the "getIncome" function, ask the user for annual income of 30 employees. then calculate and print total income on the screen using the following function: "void getIncome ( ai []);
What is the difference between a function and a method in c?
Explain how can you tell whether a program was compiled using c versus c++?
Which is better oop or procedural?