Question:Which of the following is/are the correct algorithm for printing Even or Odd according to input a number? 

A Step 1: read a number Step 2: if (number MOD 2) equal to 0 then go to step 4 Step 3: Print  

B Step 1: read a number Step 2: if (number MOD 2) equal to 0 then print  

C Step 1: read a number Step 2: if (number MOD 2) not equal to 0 then print  

D Step 1: read a number Step 2: if (number MOD 2) equal to 1 then print  

E Step 1: Set even=false Step 2: Read number Step 3: if (number MOD 2) equal to 0 then set even=true Stop 4: if even is equal to false then print  

F Step 1: Read number Step 2: if (number MOD 2) equal to 0 then print  

+ Answer
+ Report
Total Preview: 1083

Copyright © 2024. Powered by Intellect Software Ltd