Ask Question
22 June, 07:33

Write a fragment of code that will test whether an integer variable score contains a valid test score. Valid test scores are in the range 0 to 100.

+3
Answers (1)
  1. 22 June, 10:06
    0
    Following are the code in the C Programming Language.

    //set integer datatype variable

    int score;

    //check condition is the score is in the range of 0 to 100

    if (score > 0 && score < 100) {

    //print if condition is true

    printf ("Valid test scores");

    }else{

    //otherwise print the following string.

    printf ("test scores are Invalid");

    }

    Explanation:

    Following are the description of the code.

    In the following code that is written in the C Programming Language.

    Set an integer data type variable i. e., score. Then, set the if conditional statement to check the condition is the variable "score" is greater than 0 and less the 100. If the following statement is true then print "Valid test scores". Otherwise, it print "test scores are Invalid".
Know the Answer?
Not Sure About the Answer?
Get an answer to your question ✅ “Write a fragment of code that will test whether an integer variable score contains a valid test score. Valid test scores are in the range 0 ...” in 📙 Computers & Technology if there is no answer or all answers are wrong, use a search bar and try to find the answer among similar questions.
Search for Other Answers