The C89/ANSI standard requires all variables be declared at the top of a scope block. This was required because old C compilers were single pass compilers meaning they parsed, type checked, and emitted machine code during their one and only pass over the program. Since machine code is emitted as it's parsed, the amount of stack space to reserve for a given scope block needs to be known when it's encountered which is why old standards mandated that variables be declared at the top.
Newer C compilers are multi-pass compilers meaning they make multiple passes over the program. Because of this, it's no longer necessary to know how much stack space to reserve on the initial pass.
Embedded systems often use a C compiler adhering to the older C89/ANSI standard. Your teacher is likely encouraging you to declare variables at the top so you never have to think twice about it. They may give a more thorough explanation, as I have done, as the class progresses.