Factorial can be evaluated recursively and its very difficult for large numbers. So here we writing code in recursive way using for loop and while loop. Using For Loop: C++ program for factorial of a number C program for factorial…
Generally factorial of a number of a non-negative integer is the multiplication of all integers smaller than or equal to n. For example, Factorial of 6 is 6*5*4*3*2*1 which is 720. Recursive Solution: Factorial can be calculated by following recursive…
Suppose, to get first and last elements from array- Given an array, find first and last elements of it. In C++, we can use sizeof operator to find number of elements in an array. Output: Generally we shouldn’t passed the sizeof array…
These are the types of functions that are designed by the user itself for certain specific purposes, we have already discussed functions in the earlier article. There are 4 types of user defined functions, let us discuss them one by…
The function is a set of programming statements written between blocks. There is always a function or more than one function is present in a program for instance the main function. Steps to construct a function: Declaring a function in…
Through string subsequence, Suppose two strings str1 and str2, then find str1 is a subsequence of str2. A subsequence is a sequence that can be derived from another sequence by deleting some elements without changing the order of the remaining…
String palindrome c++, Here, suppose there is a string S and a binary string B, both of length N, then the task is to check if the given string S can be made palindromic by repeatedly swapping characters at any pair of indices consisting of unequal characters in the string B.…
Convert an array into another by, Suppose there are two arrays A[] and B[], both developed of a permutation of first N natural numbers, then the task is to count the minimum number of times the last array element is required to be shifted to any arbitrary position…
Minimize the length of the string by removing suffixes and prefixes of the same characters: Suppose a string S has a length of N developed only characters ‘a’, ‘b’, and ‘c’, then the task is to minimize the length of the given string, by doing the following operations…
Given two strings a and b, form a new string of length l, from these strings by combining the prefix of string a and suffix of string b. How to solve String from prefix and suffix of given two strings: 1. Get first l letters from…
In this article we are going to discuss “today developer news” from different sites, go through these articles to increase your skill. Let’s start learning…. Develop a Neural Network for Woods Mammography Dataset It can be challenging to develop a…
There are lots of features missing in java that is available in C++. Java has no Pointer. So we can’t write this above code on java. Java has no sizeof() operator. Java has no Scope Resolution Operator (: 🙂 Local…
In this article we discuss about top today developer news, knowledge sharing from various websites. So while going these sites you will take knowledge about different programming languages features and behaves in software industry. So let’s begin learning about these…
Hello friends, here I am going to discuss about top developer friendly tech news today. Please go through theses articles to learn more. Quality Sense Podcast: Sumit Agarwal — DevOps and Testing In today’s Quality Sense episode, Federico has a conversation all…
A storage class defines the visibility and the scope of a variable or a function in a program. It also defines the memory location and initial value of a variable. There are four storage classes in C: Auto Register Static…
Given a quadratic equation in the form ax2 + bx + c, find roots of it. Examples Of Quadratic Equation: Below is direct formula for finding roots of quadratic equation. Here we discuss about following cases: Here implementation of above formula:…
Here given a quadratic equation the task is to solve the equation or find out the roots of the equation. The standard form of a quadratic equation is – Examples Of Quadratic Equation: Method 1: Using the direct formula So here…
The tuple() is function called built-in function in python that can be used to create a tuple(). A tuple is an immutable sequence type. Syntax Of tuple(): Parameters Of tuple(): This function accept single parameter iterable(optional). It is iterable of…
The above problem is describe that, removing all the values present in another list i.e we are given some of the invalid numbers in one list which needs to be get ridden from the original list. So, lets’ discuss various…
While delete an item from a list in python occurred in 4 ways: remove() pop() del clear() Remove Method: The remove() method removes the specified item. Remove Specified Index: Here the pop method removes the specified index. If you do…