move to repo.or.cz
[letusc.git] / ch2 / exercises2 / ex3.c
blob0f1f302772a04ae65c9037b445657354af227c59
1 #include<stdio.h>
3 int main()
5 int hard,tensile;
6 float carbon;
8 printf("Enter hardness,carbon,Tensile strenght:");
9 scanf("%d %f %d",&hard,&carbon,&tensile);
11 if(hard>50 && carbon<0.7 && tensile>5600)
12 printf("Grade 10\n");
13 else if(hard>50 && carbon<0.7 && !tensile>5600)
14 printf("Grade 9\n");
15 else if(!hard>50 && carbon<0.7 && tensile>5600)
16 printf("Grade 8\n");
17 else if(hard>50 && !carbon<0.7 && tensile>5600)
18 printf("Grade 7\n");
19 else if((!hard>50 && !carbon<0.7 && tensile>5600)||(hard>50 && !carbon<0.7 && !tensile>5600)||(!hard>50 && carbon<0.7 && !tensile>5600))
20 printf("Grade 6\n");
21 else if(!hard>50 && !carbon<0.7 && !tensile>5600)
22 printf("Grade 5\n");
24 printf("End\n");
26 return 0;