C program to implement bit flipping.

Write a C program to implement bit flipping.C Program to setbits(x,p,n,y) that returns x with the n bits that begin at position p set to the rightmost n bits of y, leaving the other bits unchanged in the least number of lines.Bit flipping or flip bit is the complement(~) of bits. i.e., 0 to 1 …

C Program to print factors of the number.

Write a C Program to print factors of a number. Factors of a whole number are the whole numbers which are exactly divides the number. i.e reminder is equal to zero.Example: Factors of 8 are: 1, 2, 4, and 8.Read more about C Programming Language . /************************************************************ You can use all the programs on www.c-program-example.com* …

C Program to implement topological sort.

Write a c program to implement topological sort.Topological sort is the ordering vertices of a directed, acyclic graph(DAG), so that if there is an arc from vertex i to vertex j, then i appears before j in the linear ordering. Read more about C Programming Language . /************************************************************ You can use all the programs on …

K&R C Exercise 3-6: itoa with Minimum Field Width

Exercise 3-6. Write a version of itoa that accepts three arguments instead of two. The third argument is a minimum field width; the converted number must be padded with blanks on the left if necessary to make it wide enough. This is exactly what printf‘s %6d format does — the 6 is a minimum field …

K&R C Exercise 3-4: itoa — Handle INT_MIN in Integer to String

Exercise 3-4. In a two’s complement number representation, our version of itoa does not handle the largest negative number, that is, the value of n equal to −(2wordsize−1). Explain why not. Modify it to print that value correctly, regardless of the machine on which it runs. This exercise has two parts: explain the bug, then …

C Program to get the system information.

C Program to get the system information. We can use the ‘uname’ function to get the system information, which is defined in the “sys/utsname.h” library.Structure is used to hold information returned by the uname function.“uname” function members and their use:sysname returns the name of the operating system in use.release returns the current release level of …