Karthikeya Boyini has Published 2383 Articles

Program to find the perimeter of a rhombus using diagonals

karthikeya Boyini

karthikeya Boyini

Updated on 30-Jul-2019 22:30:26

161 Views

Rhombus is a simple quadrilateral whose four sides all have the same length. And perimeter of rhombus can be found by two methods.Adding all side.Using the diagonalsA quadrilateral has two diagonal and based on the length of diagonals the area and perimeter of the quadrilateral can be found.To find the ... Read More

Program to calculate area and perimeter of Trapezium

karthikeya Boyini

karthikeya Boyini

Updated on 30-Jul-2019 22:30:26

437 Views

Trapezium is a type of quadrilateral that has at least one pair of side parallel to each other. Area and perimeter of a trapezium can be found using the below formula, Perimeter = sum of all sidesArea = ½ x (sum of the lengths of the parallel sides) x perpendicular ... Read More

Program to calculate the area of an Circle inscribed in a Square

karthikeya Boyini

karthikeya Boyini

Updated on 30-Jul-2019 22:30:26

467 Views

A circle inscribed in a square is a circle which touches the sides of the circle at its ends. I.e. the diameter of the inscribed circle is equal to the side of the square. The area can be calculated using the formula “((丌/4)*a*a)” where ‘a’ is the length of side ... Read More

Program to calculate area of Circumcircle of an Equilateral Triangle

karthikeya Boyini

karthikeya Boyini

Updated on 30-Jul-2019 22:30:26

186 Views

A circumcircle is a circle that inscribes a regular polygon inside it. The triangle that is inscribed inside a circle is an equilateral triangle. Area of circumcircle of can be found using the following formula, Area of circumcircle = “(a * a * (丌 / 3))”Code Logic, The area of ... Read More

Any datatype in C++ boost library

karthikeya Boyini

karthikeya Boyini

Updated on 30-Jul-2019 22:30:26

169 Views

The boost library has large range of functionalities. The any datatype is one of them. Any datatype is used to store any type of values in variable. Some other languages like javascripts, python, we can get this kind of datatypes. In C++ we can get this feature only using boost ... Read More

Factorial of Large Number Using boost multiprecision Library

karthikeya Boyini

karthikeya Boyini

Updated on 30-Jul-2019 22:30:26

112 Views

To find the factorial of a large number, we can use the boost library. This library provides high precision numbers. Using boost multiprecision library we can get more precision than 64 bits.Example#include #include using boost::multiprecision::cpp_int; using namespace std; cpp_int Large_Fact(int number) {    cpp_int fact = 1;   ... Read More

Rule Of Three in C++

karthikeya Boyini

karthikeya Boyini

Updated on 30-Jul-2019 22:30:26

208 Views

The Rule of three is a rule of thumb when using C++. This is kind of a good practice rule that says that If your class needs any ofa copy constructor, an assignment operator, or a destructor, defined explicitly, then it is likely to need all three of them.Why is ... Read More

What is the size of int, long type as per C++ standard?

karthikeya Boyini

karthikeya Boyini

Updated on 30-Jul-2019 22:30:26

367 Views

Here we will see what are the sizes of the int and long type data in C++. The sizes are depending on the system architecture and the Operating system.So in the 32-bit system, the standard is ILP32. In this standard the int, long and the pointer variables are of 32-bits.For ... Read More

How to automatically generate a stacktrace when a gcc C++ program crashes?

karthikeya Boyini

karthikeya Boyini

Updated on 30-Jul-2019 22:30:26

2K+ Views

For Linux and we can use gcc to compile C/C++ codes. This compiler uses glibc library. We can use the backtrace() function to trace the error. This function is present inside the execinfo.h header file. In this example, we are going to display Segmentation fault error using the stack trace ... Read More

Java Program to display the contents in JTextArea

karthikeya Boyini

karthikeya Boyini

Updated on 30-Jul-2019 22:30:26

303 Views

The following is an example to display the contents of a text file in JTextArea −Exampleimport java.awt.*; import java.awt.event.*; import javax.swing.*; public class SwingDemo {    private JFrame mainFrame;    private JLabel statusLabel;    private JPanel controlPanel;    public SwingDemo() {       prepareGUI();    }    public static ... Read More

Advertisements