On Ubuntu, run man gets
in a terminal. It should show you this gets(3)
man page.
That documentation states, in written English:
Never use this function.
More generally, before programming, read documentation. For C on Linux, consider reading the man pages, this C reference, many C programming tutorials, and the C11 standard n1570.
English wikipedia also mentions gets
At last,
warning: 'implicit declaration of function ‘gets’; did you mean ‘fgets’? [-Wimplicit-function-declaration]
Seems quite clear to me, since written in English. As a rule of thumb, ensure that your program compiles without warnings. Read also How to debug small programs.
You could be interested in understanding the acronyms RTFM and STFW.
I learned C and Unix programming (in 1985) by reading SunOS3 man pages (at that time on paper, at work, sold with the Sun3/160 workstation I had the privilege to use then), from section 1 to section 9.
You could read Advanced Linux Programming before the man pages.
I have just begun my programming journey.
Then I recommend reading SICP. In my grand-father's eyes, it is still the best introduction to programming, even in 2019. See also these hints. It does not matter if SICP is using some programming language which is not very used in professional real life (but look into Guile): programming is about concepts, not about coding. The concepts you will learn with SICP surely will help you to write better C code later. Of course read http://norvig.com/21-days.html
NB. I am French (born in 1959) so not a native English speaker. But I was taught to read, including during my PhD studies, and of course during high school and by my own parents. And when I taught at university some CS stuff, the first thing I told to students is read. Never be ashamed of reading.