AYUSH MISHRA

AYUSH MISHRA

112 Articles Published

Articles by AYUSH MISHRA

Page 10 of 12

Pythagorean Triplet in an Array Using C++

C++
AYUSH MISHRA
AYUSH MISHRA
Updated on 09-Dec-2024 34K+ Views

Pythagorean Triples Pythagorean triples are a set of three distinct numbers a, b, and c which satisfy the condition: a2 + b2 = c2 These numbers a, b, and c are known as Pythagorean triples. We can say that these three numbers represent the sides of a right-angled triangle. These three sides are known as triplets of the array. Problem Description We are given an array of integers, and we have to find if there exist three distinct numbers in the array which form the Pythagorean triplet in C++. Below are examples to demonstrate the problem statement clearly: ...

Read More

Best Package Managers for Windows

AYUSH MISHRA
AYUSH MISHRA
Updated on 09-Dec-2024 10K+ Views

Package Managers is a tool used to install and update software easily in Windows. There are different tools that we need to use daily while working as software engineers. A package manager is used to install, update, manage, and uninstall software and applications. It simplifies the process, saves time, and ensures consistency. It operates through a command-line interface (CLI) which allows us to execute tasks like installing or updating software with a single command. It handles everything in the background, including dependencies. It improves security by preventing malicious software from downloading and installing all applications from official and trustworthy sources. ...

Read More

C# program to count prime numbers in an array

AYUSH MISHRA
AYUSH MISHRA
Updated on 06-Dec-2024 13K+ Views

Prime numbers are natural numbers greater than 1 with only two factors: 1 and themselves. Examples include 2, 3, 5, 7, etc. The smallest prime number is 2. Problem Description We are given an array and need to find the number of prime numbers in the array using C#. Below is an example to understand the problem: Examples Input: array = { 3, 6, 12, 7, 9, 11} Output: array = {3, 7, 11} Explanation: The numbers 3, 7, and 11 have only two factors: 1 and themselves, so they are prime numbers. Input: array = {4, ...

Read More

C# Program to Calculate the Area of a Circle

AYUSH MISHRA
AYUSH MISHRA
Updated on 04-Dec-2024 5K+ Views

What is a Circle? A circle is a round two-dimensional shape in which all the points on the surface of the circle are equal from a point known as the center. The distance between the center and any point on the boundary of a circle is known as the radius. Area of a Circle The area of a circle is the total area present inside the boundary of a circle. In this article, we are going to discuss different approaches on how we can calculate the area of a circle using C#. The formula for the Area of the ...

Read More

C# Program to Check if an Array is Sorted

AYUSH MISHRA
AYUSH MISHRA
Updated on 04-Dec-2024 5K+ Views

Problem Description We are given an array, we have to check whether the array is sorted or not. The array can be sorted in both ascending or descending order. In this article, we are going to discuss different approaches to check if an array is sorted or not using C#. Example Input: array = {1, 2, 3, 4, 5} Output: True Explanation: The array is sorted in ascending order. Input: array = {29, 28, 27, 26, ...

Read More

C# Program to Reverse a Number

AYUSH MISHRA
AYUSH MISHRA
Updated on 04-Dec-2024 7K+ Views

Reversing a number is a simple and fundamental question in the world of programming. Problem Description In this problem, we are given an integer n and we have to reverse its digit and print the reversed number. In this article, we are going to discuss different approaches to reverse a number in C#. Example Input Number = 12345 Output Reversed Number = 54321 Explanation: 54321 is the reversed form of the input number 12345 from its original order. Input Number = 8299 Output Reversed Number = 9928 Explanation: 9928 is the reversed form of the input number 8299 ...

Read More

C# Program to Find Prime Numbers Within a Range

AYUSH MISHRA
AYUSH MISHRA
Updated on 04-Dec-2024 4K+ Views

In this article, we are going to discuss how we can find prime numbers present within a given range using C#. What are prime numbers? Prime numbers are sets of natural numbers greater than 1 that have only two factors i.e. 1 and itself. They have no other positive divisors other than 1 and itself. Examples of prime numbers are 2, 3, 5, 7, etc. Which is the Smallest prime number? The smallest prime number is 2. Is 1 a prime Number? No, 1 is not a prime number. Problem Description We are given two numbers which are starting and ...

Read More

PHP Program to Check if a Number is an Armstrong Number

PHP
AYUSH MISHRA
AYUSH MISHRA
Updated on 03-Dec-2024 5K+ Views

Armstrong Number Armstrong number is a number in which the sum of its digits raised to the power of the number of digits is equal to the number itself. In this article, we are going to discuss how we can check if a given number is Armstrong number or not. Examples Let's understand Armstrong's Number with the help of some input-output examples. Input 9474 Output Yes Explanation This is a four digit-number. The digit in this number are 9, 4, 7 and 4. 9474 = 94 + 44 + 74 + 44= 6561 + 256 + 2401 + 256= ...

Read More

C# program to calculate compound interest

AYUSH MISHRA
AYUSH MISHRA
Updated on 29-Nov-2024 5K+ Views

Compound interest is interest where the interest is calculated by adding the interest that has already been calculated in a previous time period. In this article, we are going to discuss how we can calculate compound interest using C#. What is Compound Interest? Compound Interest is the interest that calculates interest on the initial principal and also includes the interest of the previous period. In compound interest, the previous interest is included in the current interest, causing the interest to grow in an exponential manner. Example Input: principal = 20, 000, rate = ...

Read More

C++ program to return all Boundary Elements of a Matrix

C++
AYUSH MISHRA
AYUSH MISHRA
Updated on 28-Nov-2024 7K+ Views

boundary elements of a matrix The boundary elements of a matrix are those elements that lie along its edges. A matrix is a two-dimensional array that can be of any given size. The boundary elements are those present on the edges of the matrix. Problem Description We are given a matrix of size m × n. We need to find the boundary elements of the matrix. Boundary elements are the elements present on the top and bottom rows and the first and last columns of the matrix. Below are examples to understand the boundary traversal of a matrix: ...

Read More
Showing 91–100 of 112 articles
« Prev 1 8 9 10 11 12 Next »
Advertisements