rfid programming for attendance system

    if(flag == 1) // If flag variable is 1, then it means the tags match
    {
      Serial.println("Matched!");
      state = !state; // Toggle state
      digitalWrite(13,state); // Apply the new state to the LED
    }

Here, where you know that a tag matched the one known tag, you would need to record that you (the owner of the one good tag) were present.

How can i modify it to display present and absent students of a class.

Plural? How can than be, when the program only recognizes one tag/student?

I am new to programming .I tried with my limited knowledge. But never got proper result.

Why are you doing this project? Isn't it because you are trying to learn something about programming?

Its time for us to submit our work.

No, it's time to submit YOUR work, not our work.