Sunidhi Bansal

Sunidhi Bansal

809 Articles Published

Articles by Sunidhi Bansal

Page 81 of 81

Program to calculate value of nCr in C++

Sunidhi Bansal
Sunidhi Bansal
Updated on 23-Sep-2019 3K+ Views

Given with n C r, where C represents combination, n represents total numbers and r represents selection from the set, the task is to calculate the value of nCr. Combination is the selection of data from the given in a without the concern of arrangement. Permutation and combination differs in the sense that permutation is the process of arranging whereas combination is the process of selection of elements from the given set. Formula for permutation is -: nPr = (n!)/(r!*(n-r)!) Example Input-: n=12 r=4 Output-: value of 12c4 is :495 Algorithm Start Step 1 -> Declare function for calculating factorial ...

Read More

Program for volume of Pyramid in C++

Sunidhi Bansal
Sunidhi Bansal
Updated on 20-Sep-2019 1K+ Views

Given with sides depending upon the type of base of pyramid the task is to calculate the volume of pyramid.Pyramid is a 3-D figure whose outer surfaces are triangular meeting at the common point forming the sharp edge of pyramid. Volume of pyramid depends upon the type of base it will have.There are different types of base a pyramid can be made up of, like −Triangular −It means pyramid will have triangular base, than the volume of pyramid will beFormula - : (1/6) * a * b * hSquare −It means pyramid will have square base, than the volume of ...

Read More

Program to calculate volume of Ellipsoid in C++

Sunidhi Bansal
Sunidhi Bansal
Updated on 20-Sep-2019 303 Views

Given with r1, r2 and r3 the task is to find the volume of ellipsoid. An ellipsoid is a quadric surface, a surface that may be defined as the zero set of a polynomial of degree two in three variables. Among quadric surfaces, an ellipsoid is characterized by either of the two following properties.Formula used to calculate volume of ellipsoidVolume of Ellipsoid : (4/3) * pi * r1 * r2 * r3ExampleInput-: r1 = 6.3, r2 = 43.4, r3 = 3.7 Output-: volume of ellipsoid is : 4224.87AlgorithmStart Step 1 -> define macro as    #define pi 3.14 Step 2 ...

Read More

Program to calculate the area between two Concentric Circles in C++?

Sunidhi Bansal
Sunidhi Bansal
Updated on 20-Sep-2019 527 Views

What is Concentric Circle?Concentric circle is the circle inside the circle which means they share common center with different radius lengths i.e. r1 and r2 where, r2>r1. Region between two concentric circles is known as annulus.Given below is the figure of Concentric CircleProblemGiven with two concentric circles of different radius lengths r1 and r2 where r2>r1. The task is to find the area between both the circles which is highlighted by the blue colour.To calculate area between two circles we can subtract the area of larger circle from smaller circleLets say, bigger circle have radius r2 and smaller circle have ...

Read More

Program for Volume and Surface Area of Cuboid in C++

Sunidhi Bansal
Sunidhi Bansal
Updated on 20-Sep-2019 844 Views

What is cuboid?Cuboid is a three-dimensional object with six faces of rectangle shape which means it has sides of different length and breadth. The difference between a cube and cuboid is that a cube has equal length, height and breadth whereas in cuboids these three are not sameProperties of cuboid are −six faces12 edges8 verticesGiven below is the figure of cubeProblemGiven with the length, width and volume, the task is to find the total surface area and volume of a cuboid where surface area is the space occupied by the faces and volume is the space that a shape can ...

Read More

Program for Volume and Surface Area of Cube in C++

Sunidhi Bansal
Sunidhi Bansal
Updated on 20-Sep-2019 973 Views

What is cube?Cube is a three-dimensional object with six faces of square shape which means it has sides of same length and breadth. Cube is the only regular hexahedron with following properties −six faces12 edges8 verticesGiven below is the figure of cubeProblemGiven with the side, the task is to find the total surface area and volume of a cube where surface area is the space occupied by the faces and volume is the space that a shape can contain.To calculate surface area and volume of a cube there is a formula −Surface Area = 6*Side*sideVolume = Side*side*sideExampleInput-: side=3 Output-: volume ...

Read More

Program for Surface area of Dodecahedron in C++

Sunidhi Bansal
Sunidhi Bansal
Updated on 20-Sep-2019 285 Views

What is Dodecahedron?The word ‘dodecahedron’ is derived from the Greek words where, dodeca means ‘twelve’ and hedron specifies ‘faces’. Dodecahedron in geometric is a 3-D platonic or regular solid with twelve flat faces. Like, other figures dodecahedron also have properties and those are −20 polyhedron vertices30 polyhedron edges12 pentagonal faces, as a pentagon is a five-sided polygonGiven below is the figure of dodecahedronProblemGiven with an edge, the program must find the surface area of dodecahedron where surface area is the total space occupied by the faces of the given figure.To calculate surface area of dodecahedron there is a formula −ExampleInput-: ...

Read More

Print leaf nodes in binary tree from left to right using one stack in C++

Sunidhi Bansal
Sunidhi Bansal
Updated on 22-Aug-2019 290 Views

Program should print the leaf nodes of a binary tree from left to right but the challenge involves is using of only one stackThrough push() function insert nodes of a binary tree and through pop() operation display the leaf nodes.Leaf nodes are the end nodes whose left and right pointer is NULL which means that particular node is not a parent node.ExampleInput : 12 21 32 41 59 33 70 Output : 41 59 33 70Stack is a data structure which is a LIFO structure in which top pointer will point to the last elements inserted so the leaf nodes ...

Read More

Print pyramid of tutorialspoint in PL/SQL

Sunidhi Bansal
Sunidhi Bansal
Updated on 09-Aug-2019 989 Views

PL/SQL stands for “Procedural Language extension to SQL” . It is the mixture of SQL and Procedural features provided by programming language. It was developed by Oracle Corporation in the late 1980s as procedural extension language for SQL and the Oracle relational database.PL/SQL programs consists of blocks that can be nested and a block structure look likes this −DECLARE    -- it contains declaration statements BEGIN    -- It contains executable statements EXCEPTIONS    -- It contains exception handling statements END;ExampleIn PL/SQL single-line comments begin with double hyphen(--) and Multi-line comments begin with a slash-asterisk ( /* ) and end ...

Read More
Showing 801–809 of 809 articles
« Prev 1 77 78 79 80 81 Next »
Advertisements