One may say modeh ani in the morning without a yarmulke on his head, however, when answering amen to a bracha it is preferable to at least cover his head with his hand. One who needs to recite a bracha where there are those who are not wearing a yarmulke, for example a mesader kedushin, can say the bracha even though they will answer amen. If possible one should offer the people in the crowd a yarmulke to wear.