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;