Skip to content

Category Archives: C++ Programs

The tellg() function is used with input streams, and returns the current “get” position of the pointer in the stream. It has no parameters and… Read More
Delete is an operator that is used to destroy array and non-array(pointer) objects which are created by new expression.  Delete can be used by either… Read More
Given a string S consisting of only characters ‘a’ and ‘b’, and an integer N. The string S is added N times to obtain string… Read More
Give a sentence, print different words present in it. Words are separated by space.  Examples:  Input : str = "Geeks for Geeks" Output : Geeks… Read More
Java import*;   class GFG {   public static void main(String[] args) {                   System.out.println("Enter The String : ");         String str = "geeksforgeeks";         StringBuffer sb… Read More
Given an array of n integers, slope of a line i. e., m and the intercept of the line i.e c, Count the number of… Read More
Given an array ‘a[]’ of size n and number of queries q. Each query can be represented by two integers l and r. Your task… Read More
We sometimes come across abnormal crash of C++ programs. Below are some possible reasons which may cause C++ to crash abnormally. Segmentation Fault: It is… Read More
Given an array, find the first element that appears even number of times in the array. It returns the element if exists otherwise returns 0.Examples:  … Read More
Given a 2-D matrix, find the element having maximum value using multi-threading. Prerequisite : Multithreading Examples : Input : {{1, 5, 3, 6}, {22, 10,… Read More
Fast inverse square root is an algorithm that estimates , the reciprocal (or multiplicative inverse) of the square root of a 32-bit floating-point number x… Read More
Given a triangular structure of numbers, find the minimum path sum from top to bottom. Each step you may move to adjacent numbers on the… Read More
Given a text txt[0..n-1] and a pattern pat[0..m-1], write a function that prints all occurrences of pat[] in txt[]. You may assume that n >… Read More
We are given an array of elements and we have to check the whether each element is even or not. Examples: Input : [2, 4,… Read More
Given a password entered by the user, check its strength and suggest some password if it is not strong. Criteria for strong password is as… Read More

Start Your Coding Journey Now!