0% found this document useful (0 votes)
8 views4 pages

Experiment 2 Sde

Uploaded by

asaini9926
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)
8 views4 pages

Experiment 2 Sde

Uploaded by

asaini9926
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/ 4

Experiment No.

: - 1
Name: - Abhishek Saini
Enrolment No.: - A20405221189
Year/Sem/Batch: - 3rd /5th /A2
Aim: - Write a C program for triangle types and write a test case using
euivelance class partition and boundary value analysis.
Objective: - To validate the triangle using equivalence class partition.
Theory: -
 C program to check the type of a triangle.
#include<stdio.h>
#include<conio.h>
#include<math.h>

void check_triangle(int x, int y, int z)


{
if((x+y)>z&&(x+z)>y&&(y+z)>x)
{
if(x==y||y==z||x==z)
{
if(x==y&&x==z&&y==z)
{
printf("Triangle is equilateral \n");
}
else
{
printf("Triangle is isosceles\n");
}
}

else
{
printf("Triangle is a scaler\n");
}

}
else
{
printf("that is not a valid triangle\n");
}
}
void main()
{
int a,b,c;
Clrscr();
printf("enter the sides of the triangle a,b,c respectively");
scanf("%d%d%d”,&a,&b,&c);
check_triangle(a,b,c);
getch();

}
 Test case table for invalid cases for a,b,c<5

Test ID Invalid Case Expected Actual Status


outcome Outcome

1. A=2 Invalid Invalid Passed


B=3 Triangle Triangle
C=4

2. A=1 Invalid Invalid Passed


B=3.4 Triangle Triangle
C=2.5

3. A=-6 Invalid Invalid Passed


B=3 Triangle Triangle
C=3

 Test case table for valid cases for 5< a,b,c<50

Test ID Valid Case Expected Actual Status


outcome Outcome

1. A=15 Triangle is Triangle is Passed


B=30 Scalar Scalar
C=25

2. A=7 Invalid Invalid Passed


B=45 Triangle Triangle
C=10

3. A=10 Triangle is Triangle is Passed


B=10 equilateral equilateral
C=10
4. A=17 Triangle is Triangle is Passed
B=17 isosceles isosceles
C=20

 Test case table for invalid cases for a,b,c>50

Test ID Invalid Case Expected Actual Status


outcome Outcome

1. A=55 Invalid Invalid Passed


B=76 Triangle Triangle
C=478

2. A=19 Invalid Invalid Passed


B=46 Triangle Triangle
C=98

3. A=23 Invalid Invalid Passed


B=56 Triangle Triangle
C=73

You might also like