to be done in c language. follow prompt
Dear Learner,
Here is the code for your solution,
#include<stdio.h>
#include<conio.h>
main()
{
int side1,side2,hypotenuse;
//Declaring the variables side1 side2 and hypotenuse
int i,j,k;
//Declaring the iterating variables
printf("side1 side2 hypotenuse\n");
// These two lines
printf("----- ----- ----------\n");
// are printed for formatting the output
for(side1=1;side1<10;i++)
// First loop for the first side
{
for(side2=side1;side2<10;j++)
//The second nested loop is for side2. NOTE that
it starts from the value
{
// of side1 in order to
reduce the number of cycles
for(hypotenuse=side2;k<10;j++)
//This loop is to find the
hypotenuse
{
if(hypotenuse*hypotenuse == side1*side1 +
side2*side2) //Checking if the third side satisfies the
hypotenuse relation
{
printf("%d\t\t%d\t\t%d\n",side1,side2,hypotenuse);
// printing the values if
true
}
}
}
}
}
CORRESONDING OUTPUT:
I have shown first and ending part of the printed values.
I hope I have explained the question the way you were expecting. If you still have any doubts or want any other explanation, feel free to ask us in the comment section.
Please leave a like if this was helpful.
Thanks,
Happy Studying.
to be done in c language. follow prompt Second Program: triples.c 8. Create a program named...
Please use only C language and NOT C++ or Java You are now allowed to use the following • for loops • math.h and pow() function • formatting float and double numbers • switch statements • getchar() function • ASCII chart • do…while loops • break and continue statements • Logical AND (&&), logical OR (||), logical NOT (!) operators Pythagorean triples are three positive integer numbers a, b, c that form the sides of a right triangle, such that...
Write the java program: A right triangle can have sides whose lengths are all integers. The set of three integer values for the length of the sides of a triangle is called a Pythagorean triple. The length of the three sides must satisfy the relationship that the sum of the squares of the sides is equal to the square of the hypotenuse. Write a Java application that prompts the user for an integer that represents the largest side value and...
C code. Write a program to find all the triangles with integer side lengths and a user specified perimeter. Perimeter is the sum of all the sides of the triangle. Integers a, b and c form a triangle if the sum of the lengths of any two sides is greater than the third side. Your program should find all the triples a, b and c where a + b + c is user specified perimeter value. Print each triple only...
PLEASE READ AND CODE IN BASIC C++ CODE. ALSO, PLEASE CODE USING THIS DO WHILE LOOP AND FORMAT: #include <iostream> using namespace std; int main() { //variables here do { // program here }while (true); } Objectives To learn to code, compile and run a program containing SELECTION structures Assignment Write an interactive C++.program to have a user input the length of three sides of a triangle. Allow the user to enter the sides...