All Easy Articles
Predict the output of below programs. Question 1  c #include<stdio.h> char *getString() {     char str[] = "Will I be printed?";        return str; } int main() {… Read More
Predict the output of below programs.  Question 1  c #include<stdio.h> int main() {    int n;    for(n = 7; n!=0; n--)      printf("n = %d", n--);    getchar();… Read More
The eight queens problem is the problem of placing eight queens on an 8×8 chessboard such that none of them attack one another (no two… Read More
What should be the “condition” so that the following code snippet prints both HelloWorld!  if "condition" printf ("Hello"); else printf("World"); Method 1: using logical NOT(!)  c… Read More
Power Set: Power set P(S) of a set S is the set of all subsets of S. For example S = {a, b, c} then… Read More
Write a one-line function to return the position of the first 1 from right to left, in the binary representation of an Integer.  Examples: Input:… Read More
Given a positive integer n, write a function to find if it is a power of 2 or not Examples:  Input : n = 4Output… Read More
Given a positive integer, write a function to find if it is a power of two or not. Examples :  Input : n = 4… Read More
Find the majority element in the array. A majority element in an array A[] of size n is an element that appears more than n/2… Read More
Given an array A[] of n numbers and another number x, the task is to check whether or not there exist two elements in A[]… Read More
Predict the output of below program #include<stdio.h> int main() {  char *ptr = "geeksforgeeks";  printf("%c\n", *&*&*ptr);      getchar();  return 0; } Output: g Explanation: The… Read More
Given a string s1 and a string s2, write a function to check whether s2 is a rotation of s1.  Examples:  Input: S1 = ABCD,… Read More
Given a pointer to a node to be deleted, delete the node. Note that we don’t have a pointer to the head node. Recommended Practice… Read More
Given two integers x and n, write a function to compute xn. We may assume that x and n are small and overflow doesn’t happen.… Read More
Given a number, find the sum of its digits.Example :  Input : n = 687Output : 21 Input : n = 12Output : 3 1.… Read More