FIFO CPU Scheduling Algorithm

Here is the code implementation of the above title:- https://ide.codingblocks.com/s/445888, the few things where I am having doubts are:-

  1. First of all, I made arr of int data type and I am putting chars of string in it, and it is not producing any error, does it mean it is internal type casting?
  2. When I am putting numeric chars of string in arr as (str[i]-‘0’ ) because arr is of int type, so no of page faults becomes 10 and if not then answer of page faults is coming out to be 9, how is it so?
  3. Is there any mistake in implementation of this algorithm because not getting expected answer.

Please comment out the mistakes if any in code so as to make it to know what is exactly the mistake.

hello @Sakshi2004
pls share the questiom link with me.

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.