CS101 - Write a pseudo code to find the number of pass students from the following list. The Passing Criteria is 50 marks. (20, 58,90,10,15,87,30,12,98)

 Answer : 

// Define the list of scores

scores = [20, 58, 90, 10, 15, 87, 30, 12, 98]


// Initialize a variable to store the count of pass students

passCount = 0 


// Loop through the list of scores

for score in scores:

    // Check if the score is greater than or equal to 50

    if score >= 50:

        // If the score is greater than or equal to 50, increment the passCount variable

        passCount = passCount + 1

    // End of if statement

// End of for loop


// Print the number of pass students

print("The number of pass students is: ", passCount)

More Explanation : 


Regards :  MS Rehman


Post a Comment

0 Comments
* Please Don't Spam Here. All the Comments are Reviewed by Admin.