Initial Basics – Algebra – Problem #33

IIT Kharagpur CS10001 / CS11001 Programming and Data Structures Lab Question Archive

Difficulty: Medium

Problem Statement

Steel is an alloy that is built of iron with typically a few tenths of a percent of carbon for im- proving its strength as well as fracture resistance in comparison to other forms of iron. Let us consider that a certain grade of steel is graded as per the given condition: Firstly, the hardness of the steel should not be less than equal to 60. Secondly, the content of the carbon in the steel should be greater than 0 and less than 0.65. Finally, strength of tensile must be greater than 6400 The grades are as follows: Grade is 10 - on satisfying all the three conditions Grade is 9 - on satisfying conditions (ii) and (iii) Grade is 8 - on satisfying conditions (i) and (ii) Grade is 7 - on satisfying conditions (i) and (iii) are satisfied Grade is 6 - if none of the conditions are satisfied Grade is 5 - if only one condition is satisfied Write a program, to take the values of hardness, carbon content and tensile strength of the steel under consideration as input from the user and output the grade of the steel. You can check for the respective grade of the steel in the same order as given in the question. Example1: (Please take the input and display the output as shown) Input: Hardness: 80 Carbon content: 0.30 Tensile strength: 5000 Output: Grade: 8

Back to Lab Problems
Initial Basics/Algebra/Problem #33

Lab Problem Statement

Specifications & Problem DetailsIIT Kharagpur PDS Archive
Loading question...

Interactive C Compiler · Problem #33

WASM In-Browser

Runs directly on your machine · Zero remote server dependency

Compiler downloads on first Run (large, saved in your browser after that)
main.cCtrl + Enter to run
1
2
3
4
5
6
7
Input (stdin)given to scanf / cin
Output

Output appears here. Press Run to compile and execute.