#include<iostream>
using namespace std;
#include<conio.h>
int main ()
{
int hd,grade,ts;
float cc;
int c1,c2,c3;
cout<<"enter hardness,carbon content and tensile strength";
cin>>hd>>cc>>ts;
c1= hd>50;
c2= cc<0.7;
c3= ts>5600;
if( c1&&c2&&c3 )
grade= 10;
else if( c1&&c2 )
grade= 9;
else if( c2&&c3 )
grade= 8;
else if( c1&&c3 )
grade= 7;
else if( c1 && c2 && c3 )
grade=6;
else
grade= 5;
cout<<"grade of steel="<<grade;
getch();
return 0;
/* Letuswithc:
this page is designed to help you learn C or C++.Understandable C and C++ programming tutorials, compiler reviews, source code, tips and tricks.
*/
}
thank you so much
ReplyDeleteHow come Grade 6 and Grade 10 same. Grade 6 should have to come with OR condition right?
ReplyDeleteyes
DeleteI want this in java
ReplyDelete