Skip to content
Open

Lab62 #113

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 50 additions & 0 deletions 6th sem (Software Testing)/comission.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
#include<stdio.h>
int main()
{
intlocks,stocks,barrels,sales,flag=0;
float commission;
printf("Enter the total number of locks\n");
scanf("%d",&locks);
printf("Enter the total number of stocks\n");
scanf("%d",&stocks);
printf("Enter the total number of barrels\n");
scanf("%d",&barrels);
if((locks<=0) || (locks>70))
{
flag=1;
printf("Locks Out of Range\n");
}
if((stocks<=0) || (stocks>80))
{
flag=1;
printf("Stocks Out of Range\n");
}
if((barrels<=0) || (barrels>90))
{
flag=1;
printf("Barrels Out of Range\n");
}
if(flag == 1)
{
printf("Invalid input\n");
return 0;
}
sales= locks*45 + stocks*30 + barrels*25;
if(sales <= 1000)
{
commission = 0.10 * sales;
}
else if(sales <= 1800)
{
commission = 0.10 * 1000;
commission = commission + (0.15 * (sales - 1000));
}
else
{
commission = 0.10 * 1000;
commission = commission + (0.15 * 800);
commission = commission + (0.20 * (sales - 1800));
}
printf("Total sales: %d and Commission: %f\n",sales,commission);
return 0;
}
50 changes: 50 additions & 0 deletions 6th sem (Software Testing)/triangle.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
#include<stdio.h>
#include<stdlib.h>
int main() {
inta,b,c;
printf("Enter the sides of the triangle:
\n");
scanf("%d%d%d",&a,&b,&c);
if((a<1 || a>10)&&(b<1 || b>10)&&(c<1 || c>10))
printf("Sides a,b and c are of out of range");
else if((a<1 || a>10)&&(b<1 || b>10))
printf("Sides a and b are out of range");
else if((b<1 || b>10)&&(c<1 || c>10))
printf("Sides b and c are out of range");
else if((a<1 || a>10)&&(c<1 || c>10))
printf("Sides a and c are out of range");
else if(a<1 || a>10)
printf("side a is out of range.");
else if(b<1 || b>10)
printf("side b is out of range.");
else if(c<1 || c>10)
printf("side c is out of range.");
else

{
if((a<b+c)&&(b<a+c)&&(c<a+b))

{
printf("Triangle is formed..
\n");
if(a==b && b==c && c==a )
printf("Equilateral triangle..
\n");
else if(a==b || b==c || c==a)
printf("Isoceles triangle..
\n");
else
printf("Scalene triangle...
\n");

}
else

{
printf("not a triangle..
\n");

}

}
return 0;