Following questions have been asked in GATE CS 2006 exam.
Read More »C allows a void* pointer to be assigned to any pointer type without a cast, whereas C++ does not; this idiom appears often in C code using malloc memory allocation. For example, the following is valid in C but not C++:
Read More »Following questions have been asked in GATE CS 2009 exam.
Read More »Let us consider the below program.
Read More »Consider the below program.
Read More »In C, a string can be referred either using a character pointer or as a character array.
Read More »Difficulty Level: Rookie
Question 1
Predict the output of below program.
Asked by geek4u
Question: Write an efficient program for printing k largest elements in an array. Elements in array can be in any order.
Asked by kapil.
You are given an array of 0s and 1s in random order. Segregate 0s on left side and 1s on right side of the array. Traverse array only once.
malloc() allocates memory block of given size (in bytes) and returns a pointer to the beginning of the block.
Read More »We need not to do anything if a number is positive. We want to change only negative numbers. Since negative numbers are stored in 2’s complement form, to get the absolute value of a negative number we have to toggle bits of the number and add 1 to the result.
Read More »In C, return type of getchar(), fgetc() and getc() is int (not char). So it is recommended to assign the returned values of these functions to an integer type variable.
Read More »Write a removeDuplicates() function which takes a list and deletes any duplicate nodes from the list. The list is not sorted.
Read More »