what is the maximum output of a i/o pin of arduino uno?

i read somewhere it is 40 mA so tell what will the output current be if the output voltage of a pin is 5v and a 1000 ohm resistor is connected to the pin. will it be 40 mA or 5/1000 = 5 mA? Do reply

It will be 5mA.
The 40mA is the point where damage will occours. You will only get that flowing if the resistor is low enough.