The coronavirus, which appeared in China in late 2019, spread over the world and became an epidemic. Although the mortality rate is not very high, it has hampered the lives of people around the world due to the high rate of spread. Moreover, compared to other individuals in the society, the mortality rate in elderly individuals and people with chronic disease is high. The early detection of infected individuals is one of the most effective ways to both fight disease and slow the outbreak. In this study, a deep learning approach, which is alternative and supportive of traditional diagnostic tools and fed with chest x-rays, has been developed. The purpose of this deep learning approach, which has the convolutional neural networks (CNNs) architecture, is (1) to diagnose pneumonia caused by a coronavirus, (2) to find out if a patient with symptoms of pneumonia on chest X-ray is caused by bacteria or coronavirus. For this purpose, a new database has been brought together from various publicly available sources. This dataset includes 50 chest X-rays from people diagnosed with pneumonia caused by a coronavirus, 50 chest X-rays from healthy individuals belonging to the control group, and 50 chest X-rays from people diagnosed with bacterium from pneumonia. Our approach succeeded in terms of accuracy of 92% for corona virus-based pneumonia diagnosis tasks (1) and 81% for the task of finding the origin of pneumonia (2). Besides, achievements for Area Under the ROC Curve (ROC_AUC), Precision, Recall, F1-score, Specificity, and Negative Predictive Value (NPV) metrics are specified in this paper.