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 / shouvik mitra
This code gives the interchange values of the two variables.But this code can also give the same result for the two variables when same numbers are inputted in both the variables, i.e. say a=5,b=5.
| Is This Answer Correct ? | 1 Yes | 1 No |
Post New Answer View All Answers
how can I convert a string to a number?
What is f'n in math?
What is queue in c?
What is file in c preprocessor?
FILE *fp1,*fp2; fp1=fopen("one","w") fp2=fopen("one","w") fputc('A',fp1) fputc('B',fp2) fclose(fp1) fclose(fp2)} a.error b. c. d.
What is a #include preprocessor?
What is the use of a static variable in c?
What is double pointer in c?
What's the best way of making my program efficient?
List a few unconditional control statement in c.
struct screen_pos{ int row, col } ;move_right(cursor)struct screen_pos *cursor;{ cursor.col++; } /* This statementhas a syntax error */What is the correct statement a) cursor.col = cursor.col + 1; b) col.cursor++; c) *cursor.col++; d) pointer
Explain what is a program flowchart and explain how does it help in writing a program?
What are two dimensional arrays alternatively called as?
Can an array be an Ivalue?
Write the Program to reverse a string using pointers.