Let us consider the below program.
Consider the below program.
In C, a string can be referred either using a character pointer or as a character array.
Difficulty Level: Rookie Question 1 Predict the output of below program.
Question: Write an efficient program for printing k largest elements in an array. Elements in array can be in any order.
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.… Read More »
The name malloc and calloc() are library functions that allocate memory dynamically. It means that memory is allocated during runtime(execution of the program) from heap… 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… 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… Read More »
Write a removeDuplicates() function which takes a list and deletes any duplicate nodes from the list. The list is not sorted.
Write a removeDuplicates() function which takes a list sorted in non-decreasing order and deletes any duplicate nodes from the list. The list should only be… Read More »
In C, printf() returns the number of characters successfully written on the output and scanf() returns number of items successfully read.
Registers are faster than memory to access, so the variables which are most frequently used in a C program can be put in registers using… Read More »
Uninitialized pointers are known as wild pointers because they point to some arbitrary memory location and may cause a program to crash or behave badly.
Following questions have been asked in GATE CS 2008 exam.