Found 33676 Articles for Programming

n-th number with digits in {0, 1, 2, 3, 4, 5} in C++

Hafeezul Kareem
Updated on 22-Oct-2021 06:33:37

346 Views

The numbers formed with the digits {0, 1, 2, 3, 4, 5} are0, 1, 2, 3, 4, 5, 10, 11, 12, 13, 14, 15, 20, 21, 22, 23, 24, 25, etc.., We can form the above sequence using the first 6 digits. Let's see an example of the formation of numbers. 1 * 10 + 0 = 10 1 * 10 + 1 = 11 1 * 10 + 2 = 12 1 * 10 + 3 = 13 1 * 10 + 4 = 14 1 * 10 + 5 = 15Similarly, apply for the number 2, 3, 4, ... Read More

n-th number whose sum of digits is ten in C++

Hafeezul Kareem
Updated on 22-Oct-2021 06:08:19

363 Views

The numbers whose digits sum is equal to 10 are19, 28, 37, 46, 55, 64, 73, 82, 91, etc.., If you observe the series, each number is incremented by 9. There are numbers in the above sequence whose digits sum does not equal 10 while incrementing by 9. But, you will get all the numbers whose digits sum is equal to 10.So, we can have a loop that increments by 9 and checks for digits sum and finds the n-th number. Let's see some examplesInputs 3 7Outputs 37 73AlgorithmInitialise the number nInitialise a counter to 0.Write a loop that iterates ... Read More

N-th multiple in sorted list of multiples of two numbers in C++

Hafeezul Kareem
Updated on 22-Oct-2021 05:54:52

217 Views

You are given three numbers. You need to find the n-th multiple from the multiples of the first two numbers. Let's see an example to understand it more clearly.Input x = 2 y = 3 n = 7Output 10The first n ****multiples of 2 are 2 4 6 8 10 12 14The first n ****multiples of 3 ****are 3 6 9 12 15 18 21If combine both multiples and sort them we get 2 3 4 6 8 9 10 12 14 15 18 21 and the nth number from the list is 10.AlgorithmInitialise a vector to store all the ... Read More

N digit numbers divisible by 5 formed from the M digits in C++

Hafeezul Kareem
Updated on 21-Oct-2021 12:57:36

203 Views

We have given a number N along with an array of M digits. Our job is to find the number of n digit numbers formed from the given M digits that are divisible by 5.Let's see some examples to understand the problem inputs and outputs.In − N = 2 M = 3 arr = {5, 6, 3}Out − 2There are 2 N digit numbers 35 and 65 possible that are divisible by 5. Let's see another example.Input − N = 1 M = 7 arr = {2, 3, 4, 5, 6, 7, 8}Output − 1There is only 1 number with ... Read More

Latin Square in C++

Hafeezul Kareem
Updated on 21-Oct-2021 09:12:56

562 Views

The Latin square is a matrix that has a special pattern. Let's see different examples to examine the pattern.1 2 2 1 1 2 3 3 1 2 2 3 1 1 2 3 4 4 1 2 3 3 4 1 2 2 3 4 1 The Latin square that you get will be of different size as you notice in the above examples. But, if you carefully observe the above matrices' pattern, you will find out that the last number of the previous row comes as the first element of the next row.That's the pattern ... Read More

How to Install Newman using NPM?

Debomita Bhattacharjee
Updated on 25-Jun-2021 13:39:59

2K+ Views

We can install Newman using npm. Newman can be installed using npm and Node.js. To download Node.js, navigate to the link − https://nodejs.org/en/download/current/.As we have downloaded Node.js successfully, we can check it with the below command −In Windowsnode --vIn Linuxnode --versionThe npm package becomes available automatically on installing Node.js. We can check it with the below command −In Windowsnpm --vIn Linuxnpm --versionFinally to install Newman, run the below command −For Windowsnewman --vFor Linuxnewman --version

How do you configure ASP.NET Core applications?

Akshay Khot
Updated on 22-Jun-2021 15:04:21

434 Views

During the development of an application, and even after it’s built, you often need to change various settings that control how the application behaves. Configuration refers to the external values that control an application's behavior, consisting of settings and parameters that the application uses at runtime.The best practice regarding storing configuration values is outside the application, instead of hard-coding them in the source code. You don’t want to recompile and restart the application every time you make a change to the configuration. There are also security implications. You don’t want to store the database connection strings or passwords in the ... Read More

Explain the ASP.NET Core support for multiple environments for development and production

Akshay Khot
Updated on 22-Jun-2021 15:10:35

1K+ Views

Running an application in production for live customers is very different from running it when you are developing it on your local machine. In production, your application is hosted on a server which has very different configurations and specifications than your computer. Various services that your application talks to, such as databases or external APIs change for production.By letting the application know which environment it’s running, you can vary the application’s behavior. ASP.NET Core makes it easy to manage various environments effortlessly. You can configure different configuration settings for different environments, and tweak them without having to recompile the application. ... Read More

How to schedule background tasks (jobs) in ASP.NET Core?

Akshay Khot
Updated on 22-Jun-2021 14:58:24

2K+ Views

Background tasks, also called as jobs, are essentially services that aren’t meant to execute during a normal flow of the application, such as sending email confirmations or periodically cleaning up the database to purge the inactive accounts. These jobs are not meant to interact with the customers or process user input. Rather, they run in the background, handling items from a queue or executing a long-running process.A primary advantage of performing these tasks in a background job or service, you can keep the application responsive. For example, when a user signs up, instead of sending them an email in the ... Read More

What is SignalR and how to use it?

Akshay Khot
Updated on 22-Jun-2021 14:57:48

4K+ Views

In typical web applications, the communication flow is one-way, i.e. from client to the server. The client initiates a request to the server, the server performs some task, and sends the response to the client.SignalR is an open-source project that enables real-time, bi-directional web communication from server to clients. Using SignalR, you can write server-side code that can communicate with the clients instantly.SignalR simplifies the process of adding real-time web functionality to web applications, where the server code pushes content to connected clients as soon as it becomes available. This frees the clients from repeatedly polling the server, and having ... Read More

Advertisements