how to swap two nubers by using a function with pointers?
Answer / reshma
void swap(int *a, int *b)
{
int tmp;
tmp=*a;
*a=*b;
*b=tmp;
}
or
void swap(int *a, int *b)
{
*a=*a^*b;
*b=*a^*b;
*a=*a^*b;
}
| Is This Answer Correct ? | 10 Yes | 1 No |
How do I determine whether a character is numeric, alphabetic, and so on?
Why do we use & in c?
What is sparse file?
What is the difference between declaring a variable by constant keyword and #define ing that variable?
Why c is faster than c++?
Write a program to know whether the input number is an armstrong number.
What are the differences between new and malloc in C?
write an algorithm and a program to count the number of elements in a circularly singly linked list
Write a function that will take in a phone number and output all possible alphabetical combinations
why arithmetic operation can’t be performed on a void pointer?
1) There is a singing competition for children going to be conducted at a local club. Parents have been asked to arrive at least an hour before and register their children’s names with the Program Manager. Whenever a participant registers, the Program Manager has to position the name of the person in a list in alphabet order. Write a program to help the Program Manager do this by placing the name in the right place each time the Program Manger enters a name. 2) the Event Manager has to send participants to the stage to perform in the order in which they registered. Write a program that will help the Event Manager know who to call to the stage to perform. The Logic should be in Data Structures
Why array is used in c?