All Easy Articles
There are two sorted arrays. First one is of size m+n containing only m elements. Another one is of size n and contains n elements.… Read More
While a pointer to a variable or an object is used to access them indirectly, a pointer to a function is used to invoke a… Read More
Here is the standard prototype of printf function in C: int printf(const char *format, ...); The format string is composed of zero or more directives:… Read More
At the first look, it seems that writing a C macro which prints its argument is child’s play.  Following program should work i.e. it should… Read More
  Write an efficient program to count the number of 1s in the binary representation of an integer.Examples :  Input : n = 6Output :… Read More
Given two values n1 and n2 in a Binary Search Tree, find the Lowest Common Ancestor (LCA). You may assume that both values exist in… Read More
Given the roots of a tree. print out all of its root-to-leaf paths one per line.. Algorithm: initialize: pathlen = 0, path[1000] /*1000 is some max… Read More
Asked by Anshya. Base 14: Decimal numbersBase 14 numbers0011223344556677889910A11B12C13D14D1 Below are the different ways to add base 14 numbers.Method 1 Thanks to Raj for suggesting this… Read More
We all know that a function in C can return only one value. So how do we achieve the purpose of returning multiple values. Well,… Read More
First of all, what is function overloading? Function overloading is a feature of a programming language that allows one to have many functions with same… Read More
Given a linked list, check if the linked list has a loop (cycle) or not. The below diagram shows a linked list with a loop. … Read More
Given a pointer to the head node of a linked list, the task is to reverse the linked list. We need to reverse the list… Read More
Given pointer to the head node of a linked list, the task is to reverse the linked list. We need to reverse the list by… Read More
A permutation also called an “arrangement number” or “order,” is a rearrangement of the elements of an ordered list S into a one-to-one correspondence with… Read More
Predict the output of below programs Question 1   c int main(){    while(1){        if(printf("%d",printf("%d")))            break;        else            continue;    }    return 0;} Output: Can’t be predictedExplanation: The condition in while loop is 1 so at first shot it… Read More
extern keyword in C applies to C variables (data objects) and C functions. Basically, the extern keyword extends the visibility of the C variables and… Read More
 What are these? Little and big endian are two ways of storing multibyte data-types ( int, float, etc). In little endian machines, last byte of binary… Read More
Solution: Use sprintf() function. #include<stdio.h> int main() {     char result[50];     float num = 23.34;     sprintf(result, "%f", num);     printf("\n The string for the num is %s",… Read More
Write a “C” function, int addOvf(int* result, int a, int b) If there is no overflow, the function places the resultant = sum a+b in… Read More
Predict the output of the below program. Question 1  c #include <stdio.h>int main(){  printf("%p", main);  getchar();  return 0;} Output: Address of function main. Explanation: Name of the function is actually… Read More