Hello Nino, Thank you for your reply! In line 7, I use the pattern %[^\n] for getting input for char array till a new line char using scanf. I'm not using/connecting any specialized/embedded device/target or interface. Just running the IDE on my computer and inputting through console provided in run and debug window.
I know this is an unsecure way of using scanf. When I use this in any other web/local IDE, program works. I'm using Segger Embedded Studio for RISCV V 5.60a 64 bit non commercial license for non embedded learning purpose C Source Code (16 lines)