AYUSH MISHRA

AYUSH MISHRA

112 Articles Published

Articles by AYUSH MISHRA

Page 9 of 12

C++ Program to Calculate Volume of Capsule

C++
AYUSH MISHRA
AYUSH MISHRA
Updated on 27-Jan-2025 17K+ Views

A capsule is a three-dimensional geometric shape that consists of a cylindrical body with hemispherical ends on both sides. The volume of a capsule can be calculated by adding the volume of the cylindrical part and the volume of the two hemispherical ends present on both sides of the cylindrical part. In this tutorial, we are going to discuss how to find the volume of a given capsule in C++ using different approaches. Formula for Volume of Capsule The formula for the volume of a capsule is as follows: Volume of Capsule = Volume of cylinder + Volume of both ...

Read More

C++ Program to Print Hollow Square Pattern

C++
AYUSH MISHRA
AYUSH MISHRA
Updated on 23-Jan-2025 20K+ Views

When we start learning to code, practicing star patterns is one of the best ways to improve logic building. One of the simplest yet fascinating patterns is the hollow square pattern. In this article, we are going to learn how to print a Hollow Square Pattern using C++. What is Hollow Square Pattern? A hollow square pattern is a geometrical arrangement of stars forming a square shape, but the stars are present only at the boundary of the square. The stars are printed in such a manner that the edges of the square are filled with stars, while the interior ...

Read More

Java Program to Find the Volume of Capsule

AYUSH MISHRA
AYUSH MISHRA
Updated on 22-Jan-2025 6K+ Views

A capsule is a three-dimensional geometric figure that consists of a cylindrical body with hemispherical ends on both sides. The volume of a capsule can be calculated by adding the volume of the cylindrical part and the volume of the two hemispherical ends present on both sides of the cylindrical part. In this tutorial, we are going to discuss how to find the volume of a given capsule in Java using different approaches. Formula for Volume of Capsule The formula for the volume of a capsule is as follows: Volume of Capsule = Volume of cylinder + Volume of both ...

Read More

Python Program for Fahrenheit to Celsius conversion

AYUSH MISHRA
AYUSH MISHRA
Updated on 21-Jan-2025 15K+ Views

Problem Description In this problem, we are given a temperature value in Fahrenheit and we have to convert it to Celsius. This conversion is used in various real-world applications such as weather applications, scientific calculations, and data analysis. In this article, we are going to discuss, how we can convert Fahrenheit temperature to Celsius temperature in Python. Formula to Convert Fahrenheit to Celsius The formula for converting Fahrenheit to Celsius is: Celsius = (Fahrenheit - 32) / 1.8 Example 1 Input: Fahrenheit = 98.6 Output: Celsius = 37°C Explanation: The ...

Read More

Remove Duplicates from an Unsorted Array in C++

C++
AYUSH MISHRA
AYUSH MISHRA
Updated on 21-Jan-2025 6K+ Views

Problem Description In this problem, we are given an unsorted array, and the task is to remove all duplicate elements from the array. The resulting array should only contain unique elements. In this article, we are going to explore different approaches to removing duplicates from an unsorted array in C++. Example 1 Input: array = {4, 3, 2, 4, 1, 3, 2} Output: {4, 3, 2, 1} Explanation: The duplicate elements (4, 3, 2) are removed, leaving only unique elements. Example 2 Input: array ...

Read More

C++ program to calculate potential energy if mass and height are given

C++
AYUSH MISHRA
AYUSH MISHRA
Updated on 20-Jan-2025 14K+ Views

What is Potential Energy? Potential energy is a type of stored energy stored by an object due to its position relative to other objects. It is an important concept in physics and is commonly calculated when studying objects in gravitational fields. In this tutorial, we are going to learn how to calculate the potential energy of an object in C++ if the mass and height are given. Formula for Calculating Potential Energy The formula for potential energy is as follows: Potential Energy = m × g × h Where:m is the mass of the object (in kilograms).g is the gravitational ...

Read More

Finding sum of alternative elements of the array using C++

C++
AYUSH MISHRA
AYUSH MISHRA
Updated on 17-Jan-2025 7K+ Views

The sum of alternate elements has various real-life applications such as signal processing, data compression, pattern recognition, gaming, and financial data analysis. Problem Description In this article, we are going to learn how to find the sum of alternate elements of an array in C++. Alternate elements are present at even or odd indices of the array, depending on how we define them.  Example 1 Inputarray = [1, 2, 3, 4, 5] OutputSum_even = 9Sum_odd = 6 Explanation The alternate elements at the even index are 1, 3, 5 (at ...

Read More

Python program to find perimeter of rectangle

AYUSH MISHRA
AYUSH MISHRA
Updated on 15-Jan-2025 6K+ Views

A rectangle is a closed two-dimensional figure having 4 sides. The opposite sides are equal and parallel. The angle made by the adjacent side is equal to 90 degrees. The perimeter is the sum of all sides; in other words, the perimeter is two times the sum of length and breadth. In this tutorial, we are going to learn how we can find the perimeter of a given rectangle in Python using different approaches. Formula of Perimeter of Rectangle The formula for the perimeter of a rectangle is as follows: Perimeter of Rectangle = 2 × (length + breadth) ...

Read More

Python program to find volume of capsule

AYUSH MISHRA
AYUSH MISHRA
Updated on 15-Jan-2025 5K+ Views

What is Capsule and Its Volume? A capsule is a three-dimensional geometric figure that consists of a cylindrical body with hemispherical ends on both sides. The volume of a capsule can be calculated by adding the volume of the cylindrical part and the volume of the two hemispherical ends present on both sides of the cylindrical part. In this tutorial, we are going to discuss how to find the volume of a given capsule in Python using different approaches. Formula for Volume of Capsule The formula for the volume of a capsule is as follows: Volume of Capsule = ...

Read More

Python program to find perimeter of square

AYUSH MISHRA
AYUSH MISHRA
Updated on 15-Jan-2025 5K+ Views

A square is a closed two-dimensional figure having 4 equal sides. Each angle of a square is 90 degrees. The perimeter of a square is the sum of all its sides. Problem Description In this problem, we are given the side of a square, and we have to find the perimeter of the square. In this tutorial, we are going to find the perimeter of a given square in Python using different approaches. Example 1 Input: side = 6 units Output: 24 units Explanation Using the formula to calculate ...

Read More
Showing 81–90 of 112 articles
Advertisements