- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
C++ program to find fourth side of a quadrilateral
Suppose we have three numbers a, b and c. We want to make a closed fence in a shape of arbitrary non-degenerate simple quadrilateral. We already have three sides of length a, b and c. We have to find another side d.
So, if the input is like a = 12; b = 34; c = 56, then the output will be 42, other answers are also possible.
Steps
To solve this, we will follow these steps −
return a + b + c - 2
Example
Let us see the following implementation to get better understanding −
#include<bits/stdc++.h> using namespace std; int solve(int a, int b, int c){ return a+b+c-2; } int main(){ int a = 12; int b = 34; int c = 56; cout << solve(a, b, c) << endl; }
Input
12, 34, 56
Output
100
- Related Articles
- Program to find the angles of a quadrilateral in C++
- Three angles of a quadrilateral are respectively equal to $110^o, 50^o$ and $40^o$. Find its fourth angle.
- Program to find the left side view of a binary tree in C++
- 8085 Program to Check the fourth bit of a byte
- The lengths of three consecutive sides of a quadrilateral circumscribing a circle are ( 4 mathrm{~cm}, 5 mathrm{~cm} ), and ( 7 mathrm{~cm} ) respectively. Determine the length of the fourth side.
- C++ program to find the side of the Octagon inscribed within the square
- ABCD is a cyclic quadrilateral (see figure). Find the angles of the cyclic quadrilateral."
- How to get Fourth Element of the Tuple in C#?
- Find Maximum side length of square in a Matrix in C++
- Three angles of a quadrilateral are ( 75^{circ}, 90^{circ} ) and ( 75^{circ}. The fourth angle is(a) ( 90^{circ} ) (b) ( 95^{circ} ) (c) ( 105^{circ} ) (d) ( 120^{circ} )
- C++ Program to Find Transpose of a Matrix
- C Program to find size of a File
- C++ Program to get blocks position after right side rotation
- Find the length of the fourth side of the figure with AB =10CM, CB = 5 cm, CD = 10 cm and AD parallel to CB and DC parallel to AB.
- Maximum area of quadrilateral in C++

Advertisements