0% found this document useful (0 votes)
98 views3 pages

May Be From Interval (1,100) .The Program Output May Be One of The Following (Scalene, Isosceles, Equilateral, Not A Triangle) - Perform BVA

The document describes a program that determines the type of triangle based on three positive integer side lengths entered by the user between 1-100. The program outputs whether the triangle is scalene, isosceles, equilateral, or not a triangle. It includes test cases with the input side lengths and expected output.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
98 views3 pages

May Be From Interval (1,100) .The Program Output May Be One of The Following (Scalene, Isosceles, Equilateral, Not A Triangle) - Perform BVA

The document describes a program that determines the type of triangle based on three positive integer side lengths entered by the user between 1-100. The program outputs whether the triangle is scalene, isosceles, equilateral, or not a triangle. It includes test cases with the input side lengths and expected output.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

Program 7:- To determine the type of triangle.

Its input is triple of +ve integers (say x,y,z) and the values
may be from interval[1,100].The program output may be one of the following [Scalene, Isosceles,
Equilateral, Not a Triangle]. Perform BVA.

Robust Case Testing


Test cases A B C Result
1. 99 50 50 Isosceles triangle
2. 50 99 50 Isosceles triangle
3. 50 50 99 Isosceles triangle
4. 50 50 0 Invalid
5. 50 0 50 Invalid
6. 0 50 50 Invalid
7. 1 50 50 Isosceles triangle
8. 50 1 50 Isosceles triangle
9. 50 50 1 Isosceles triangle
10. 50 50 50 Equilateral triangle
11. 100 50 50 Isosceles triangle
#include <stdio.h>

int main()

int a, b, c;

printf("Enter the value of a(domain 0-100): ");

scanf("%d", &a);

printf("Enter the value of b(domain 0-100): ");

scanf("%d", &b);

printf("Enter the value of c(domain 0-100): ");

scanf("%d", &c);

if((a<=100&&a>=0)&&(b<=100&&b>=0)&&(c<=100&&c>=0))

int D = b*b-4*a*c;

if (a == 0)

printf("Not a Quadratic Equation");

return;

if (D > 0)
{

printf("These Real Roots");

else if (D == 0)

printf("These Equal Roots");

else

printf("These Imaginary Roots");

else

printf("~~~~~~~~Enter values within the domain~~~~~~~~");

return 0;

#include <stdio.h>

int main()

int a, b, c;

printf("Enter the sides of triangle(domain 0-100): ");

scanf("%d %d %d", &a, &b, &c);

if((a<=100&&a>=0)&&(b<=100&&b>=0)&&(c<=100&&c>=0))

if(a==b && b==c) {

printf("~~~~This is an equilateral triangle~~~~.\n");

else if(a==b || a==c || b==c)


{

printf("~~~~This is an isosceles triangle.~~~~\n");

else

printf("~~~~This is a scalene triangle.~~~~\n");

else

printf("~~~~~~~~Enter values within the domain~~~~~~~~");

return 0;

You might also like