 
 Data Structure Data Structure
 Networking Networking
 RDBMS RDBMS
 Operating System Operating System
 Java Java
 MS Excel MS Excel
 iOS iOS
 HTML HTML
 CSS CSS
 Android Android
 Python Python
 C Programming C Programming
 C++ C++
 C# C#
 MongoDB MongoDB
 MySQL MySQL
 Javascript Javascript
 PHP PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Server Side Programming Articles - Page 1319 of 2650
 
 
			
			588 Views
In this tutorial, we are going to write a program that divides a number into two parts which are divisible by the given numbers.We have given a number in string format and two other integers. The program should return whether it's possible to divide the given number into two parts such that the first part is divisible by the first number and the second part is divisible by the second part.Let's see the steps to solve the problem.Initialize the number and two integers for the division.Iterate over the number until the first part is divisible by the first number.Form the ... Read More
 
 
			
			3K+ Views
In this tutorial, we are going to learn how to divide a large number that is represented as a string.We have given a large number in string format and a divisor. Our program should find a reminder.First, we will find a part of the given number that is greater than the dividend. And then we will add the remaining digits one by one to the divisor.Let's see the steps to solve the problem.Initialize the large number along with a divisor.Iterate over the given number until we extract the part that is greater than the divisor.Now, iterate from where we left ... Read More
 
 
			
			1K+ Views
In this tutorial, we are going to write a program that divides one array of elements by another array of elements.Here, we are following a simple method to complete the problem. Let's see the steps to solve the problem.Initialize the two arrays.Iterate through the second array and find the product of the elements.Iterate through the first array and divide each element with a product of the second array elements.ExampleLet's see the code. Live Demo#include using namespace std; void divideArrOneWithTwo(int arr_one[], int arr_two[], int n, int m) { int arr_two_elements_product = 1; for (int i = 0; i < ... Read More
 
 
			
			1K+ Views
In this tutorial, we are going to write a program that divides the given string into N equal parts.If we can't divide the string into N equal parts, then print the same thing. Let's see the steps to solve the problem.Initialize the string and N.Find the length of the string using the size method.Check whether the string can be divided into N parts or not.If string can't divide into N equal parts, then print a message.Else iterate through the string and print each part.ExampleLet's see the code. Live Demo#include using namespace std; void divideTheString(string str, int n) { int ... Read More
 
 
			
			749 Views
In this tutorial, we are going to write a program that divides the given number into two partsIt's a straightforward problem to solve. We can get a number by diving the given number. And we can get the second number by subtracting the result from the total.If the given number is n, then the two numbers area = n / 2 b = n - aExampleLet's see the code. Live Demo#include using namespace std; void divideTheNumber(int n) { int a = n / 2; int b = n - a; cout
 
 
			
			185 Views
In this tutorial, we are going to write a program that divides a number into two parts with a difference of k.Let's see an example.Inputn = 100 k = 30Output65 35Here, we need to understand a little bit of math before diving into the problem. Let's see it.We have a + b = n and a - b = k. By adding the two equations, we geta = (n + k)/2 b = n - aExampleThat's it. We have n and k. And there is nothing more in it. Let's see the code Live Demo#include using namespace std; void divideTheNumber(int ... Read More
 
 
			
			263 Views
In this tutorial, we are going to learn how to distribute n balls for k students without hurting anyone.The idea is simple, we have n balls in different colors that need to be distributed to the students. We don't have to give more than one ball of the same color to any student. If it is possible for a student to get more than one ball of the same color, then distribution should not happen.Let's see an example.Inputn = 10 k = 5 ballsColors = "rrrgbrbgbr"OutputYesNo color is more than the number of students (k). So, no student will get ... Read More
 
 
			
			293 Views
In this tutorial, we are going to write a program that finds the sun of two array elements and store them into a separate array.We have given two arrays and we need to add the corresponding index elements from the two arrays. If the sum is not single digits, then extract the digits from the number and store them in the new array.Let's see an example.Inputarr_one = {1, 2, 32, 4, 5} arr_two = {1, 52, 3}Output2 5 4 3 5 4 5Let's see the steps to solve the problem.Initialize two arrays with dummy data.We are using the vector to ... Read More
 
 
			
			1K+ Views
In this tutorial, we are going to learn how to find the digital root of a given number.The digital root is the sum of a number of digits (until the sum of the digits becomes a single digit).We are given an integer in string format. And we have to find the sum of the digits repeatedly until the sum becomes a single digit.Let's see the steps to solve the problem.Initialize an integer in the string format.Iterate through the number and add each digit to the sum variable.If the sum is 0, then print 0.Else if the sum is divisible by ... Read More
 
 
			
			324 Views
In this tutorial, we are going to write a program that finds the total number of substrings that starts and ends with the given strings.We are given one string and two substrings. We need to find the different substrings count that starts and ends with the given two substrings. Let's see an example.Inputstr = "getmesomecoffee" start = "m" end = "e"Output6There are a total of 6 different substrings in the given string. They are me, mesome, mesomemecoffe, mesomemecoffee, mecoffe, mecoffee.Let's see the steps to solve the problem.Initialize the strings.Iterate over the str and find the start and end substrings indexes. ... Read More