Tata Steel grades the steel produced at its Jamshedpur plant on the following parameters. i) Hardness must be greater than 50. ii) Carbon content mmust be less than 0.7 iii) Tensile strength must be greater than 1500 a) If all three conditions are met then grade 10. b) If the first two conditions are met then grade 9. c) If the last two conditions are met then grade 8. d) If the first and third conditions are met then grade 7. e) If any one condition is met then grade 6. f) If none of the conditions are met then grade 5.

#include <stdio.h>

int main(void)
{
int hard, strength;
float carbon;

printf( "\nEnter the hardness, carbon content and strength : " );
scanf("%d%f%d", &hard, &carbon, &strength);


if(hard > 50 && carbon > 0.7 && strength > 1500)
{
printf( "\nGrade 10" );
}
else if(hard > 50 && carbon > 0.7 && strength <= 1500)
{
printf( "\nGrade 9" );
}
else if(hard <= 50 && carbon > 0.7 && strength > 1500)
{
printf( "\nGrade 8" );
}
else if(hard > 50 && carbon <= 0.7 && strength > 1500)
{
printf( "\nGrade 7" );
}
else if(hard > 50 || carbon > 0.7 || strength > 1500)
{
printf( "\nGrade 6" );
}
else
{
printf( "\nGrade 5" );
}

return 0;
}

No comments:

Post a Comment

kiss on google ads if you are anonymous because your ip is trackable.thank you.

......from.admin