All Basic Articles
Predict the output of the below program.  C++ #include <iostream> using namespace std;   int main() {     int x = 5;     int * const ptr… Read More
Predict the output of the below program   C++ #include <iostream> using namespace std;   #define square(x) x*x   int main() {   int x;   x… Read More
Given two strings string1 and string2, remove those characters from the first string(string1) which are present in the second string(string2). Both strings are different and… Read More
Write a GetNth() function that takes a linked list and an integer index and returns the data value stored in the node at that index… Read More
Algorithm: Let input string be "geeksforgeeks" 1: Construct character count array from the input string. count['e'] = 4 count['g'] = 2 count['k'] = 2 …… 2: Print all the indexes from the constructed array which have value greater than 0.
Given a string S which may contain lowercase and uppercase characters. The task is to remove all duplicate characters from the string and find the… Read More
Given a number, find the sum of its digits. Examples :  Input: n = 687Output: 21 Input: n = 12Output: 3 Recommended Practice Sum Of… Read More
Given a number, find sum of its digits.Example :   Input : n = 687 Output : 21 Input : n = 12 Output : 3… Read More
If we take a look at this problem carefully, we can see that the idea of “loop” is to track some counter value, e.g., “i… Read More
Given string str. The task is to find the maximum occurring character in the string str. Examples: Input: geeksforgeeksOutput: eExplanation: ‘e’ occurs 4 times in the… Read More