![welcome2protec.com | free online IT tutorials Sum of angles of triangle | Protec](https://codeforwin.org/ezoimgfmt/secureservercdn.net/160.153.138.219/b79.d22.myftpupload.com/wp-content/uploads/2015/05/triangle.png?ezimgfmt=rs:235x224/rscb1)
Monday, July 6, 2020
Program to find angles of a triangle if two angles are given
Program to find angles of a triangle if two angles are given:
Write a C program to find third angle of a triangle if any two angles are given by user. How to find and waht is the logic to find angles of a triangle is given below.
Properties of triangle:
![welcome2protec.com | free online IT tutorials Sum of angles of triangle | Protec](https://codeforwin.org/ezoimgfmt/secureservercdn.net/160.153.138.219/b79.d22.myftpupload.com/wp-content/uploads/2015/05/triangle.png?ezimgfmt=rs:235x224/rscb1)
Remember: The sum of three interior angles of a triangle is 180°
For Example:
Required knowledge for this exercise is:
Before writing any program you just imagine about output screen first. For example, what input to be given, and output to be displayed. Let's have a look at the below example:
INPUT:
Enter any angles of a triangle = 45, 60
OUTPUT:
Thirs angle of a triangle = 75
Logic to find any angle of a triangle:
Step by step logic to find any angle of a triangle.
1) Print a massage to the user like "Enter any two angle of triangle:" using printf();
2) Input any two angle of a triangle from user using scanf(); and store it in variables a and b.
3) Now find thrid angle of a triangle using farmulla c = 180 - (a + b);
4) At last print the value of variable c. that's it!
Program to find angle of a triangle if two angles are given:
Output:
Next topic >> to be updated soon.
![](https://1.bp.blogspot.com/-lJ032BJI94Q/X4ipUPtN2GI/AAAAAAAACSs/cS6fBwan9yQBdk_fc6XRAhmocOOa2IPLQCLcBGAsYHQ/s320/Programming.png)
![](https://1.bp.blogspot.com/-zQn-y7fhFik/YLi8qbneaGI/AAAAAAAACrI/V_GVh5i94fssrE37V_AJiqgz21T8s9CAgCPcBGAYYCw/s320/Banner1.png)
![](https://1.bp.blogspot.com/-gmKYAtzLob0/X5KV37IV1sI/AAAAAAAACT8/v7-nc7S2pAUCDQpZvJgcBo17fOiZ37Q6wCLcBGAsYHQ/s320/Job%2BInterview%2BSkills.png)
![](https://1.bp.blogspot.com/-uOwbXCHRWi0/X5KV4Ox89UI/AAAAAAAACUA/XJTxI1jFv5s7HODVnBKXs5AVzaRg_FemgCLcBGAsYHQ/s320/WebDesigning.png)
![](https://1.bp.blogspot.com/-zQn-y7fhFik/YLi8qbneaGI/AAAAAAAACrI/V_GVh5i94fssrE37V_AJiqgz21T8s9CAgCPcBGAYYCw/s320/Banner1.png)
![](https://1.bp.blogspot.com/-gmKYAtzLob0/X5KV37IV1sI/AAAAAAAACT8/v7-nc7S2pAUCDQpZvJgcBo17fOiZ37Q6wCLcBGAsYHQ/s320/Job%2BInterview%2BSkills.png)
![](https://1.bp.blogspot.com/-1wlFAhlf1Tg/X4ipTqmsrWI/AAAAAAAACSk/hbA5yzIWIpQHFVM5Q8DzG9_U8-I0BsPJQCLcBGAsYHQ/s320/HW.png)
![](https://1.bp.blogspot.com/-gmKYAtzLob0/X5KV37IV1sI/AAAAAAAACT8/v7-nc7S2pAUCDQpZvJgcBo17fOiZ37Q6wCLcBGAsYHQ/s320/Job%2BInterview%2BSkills.png)
![](https://1.bp.blogspot.com/-HjTj0VEhg38/X5KV2TSF9nI/AAAAAAAACTk/dl0t2hQ3cP8nH8Vp2xnzClh3dGpyrBrbgCLcBGAsYHQ/s320/Blogging.png)
![](https://1.bp.blogspot.com/-PpK2776r0h4/X5KV34uGW9I/AAAAAAAACT4/EveLCjuu8R848djxa4Nkmantqa9O5pL8ACLcBGAsYHQ/s320/Interview%2BQ%2526A.png)
![](https://1.bp.blogspot.com/-zQn-y7fhFik/YLi8qbneaGI/AAAAAAAACrI/V_GVh5i94fssrE37V_AJiqgz21T8s9CAgCPcBGAYYCw/s320/Banner1.png)
Help others by sharing this page.
![](https://lh3.googleusercontent.com/-YHJx9KRn5n0/WFt46p7yV2I/AAAAAAAABJ4/VInfJae6dYEr6hPWsy62CWfKXXhVMi1HACEwYBhgLKtQDAL1OcqzCtoeJ-i2dap0xXlyTzO7oa4gl7ISXXXUU3JFpJ-1I9ZoLTzaXCWKFnc8lqUtjI4GDkkfuHpmhrLbzmW8MCTjsV9eU7pCZzjuNDsRH2O0toLnmE-WwxjhMHW4ANmE36hxVPCjEe5yUsts1kkh3D-ieuhWfuTY4y_qy8B931M08I6w8B2QLoa-ecdFIopHhBZUXJzV7uT_gFXLCOUa2VxYrbzjLVFRyJXgnBDkPakqLtbSMLabAOhBGDssBAyPoXT0ba1UvwTroN0-UXcTY-UjnlC73V957_IX6HtWUnTIW4--Y_ztDWOAYgGWoDjHWgmVkFOB98diRcRVXjieHHGALfnQKUQuIddHsAA2dP1bkVXI94B2EHegYQRut3zDK3246xhbWrOn7ZoFri2zF_uMUAV3XFkeAIMnADvOF4yKwyx_ehH0xPkj1x3fensBVm7JH1uEI-Eg9zv_dJN_pZHdCNO9tobyDYruKvY8pTHxtpLyZSDzJHLoVs6ovr7_dspUkASUw5DMIlIHFJoVymq0mszqBrypz3d55fQjjZV6WKSq5xJeKPR6uNfw-r3kERqE53oXnhum5rGY_fSoqyMAwdSJkktSt4Pz5z0EDcf6IMNDH7PsF/w139-h140-p/WP_20161029_16_18_44_Selfie.jpg)
Ahmad Irshad
Author & Editor
I love blogging, teaching, learning computer science and sharing it to others. I've written and develped this site so that students may learn computer science related tutorials eaisly. MCA / MCITP
Monday, July 06, 2020
C
Subscribe to:
Post Comments (Atom)
0 Comments:
Post a Comment
Please don't enter any spam link in the comment box.