write a program to swap two numbers without using temporary
variable?
Answer Posted / sam
let a and b be variables
a^=b^=a^=b;
by performing this logic from right hand side we can swap
two variables
| Is This Answer Correct ? | 6 Yes | 5 No |
Post New Answer View All Answers
What are the various types of control structures in programming?
Linked list is a Linear or non linear explain if linear how it working as a non linear data structures
What is printf () in c?
What does main () mean in c?
Write a program to replace n bits from the position p of the bit representation of an inputted character x with the one's complement. Method invertBit takes 3 parameters x as input character, p as position and n as the number of positions from p. Replace n bits from pth position in 8 bit character x. Then return the characters by inverting the bits.
Write the program with at least two functions to solve the following problem. The members of the board of a small university are considering voting for a pay increase for their 10 faculty members. They are considering a pay increase of 8%. Write a program that will prompt for and accept the current salary for each of the faculty members, then calculate and display their individual pay increases. At the end of the program, print the total faculty payroll before and after the pay increase, and the total pay increase involved.
main() { printf("hello"); fork(); }
What are keywords in c with examples?
Can the sizeof operator be used to tell the size of an array passed to a function?
What is putchar() function?
Write a C program that will accept a hexadecimal number as input and then display a menu that will permit any of the following operations to be carried out: Display the hexadecimal equivalent of the one's complement. (b) Carry out a masking operation and then display the hexadecimal equivalent of the result. (c) Carry out a bit shifting operation and then display the hexadecimal equivalent of the result. (d) Exit. If the masking operation is selected, prompt the user lor the type of operation (bitwise and, bitwise exclusive or, or bitwise or) and then a (hexadecimal) value for the mask. If the bit shifting operation is selected. prompt the user for the type of shift (left or right), and then the number of bits. Test the program with several different (hexadecimal) input values of your own choice.
Write a code of a general series where the next element is the sum of last k terms.
An instruction which is analysed and acted upon by the processor prior to the compiler going its work a) directive b) constructive c) constant d) absolute mode
What is malloc() function?
What is calloc in c?