When reading from standard input, do not mix C library functions, such as fgets(), and C++ std::cin operators. The C library knows nothing about what the C++ library is doing.
Change your code to use only stdin, or only std::cin, to read standard input.
solved Why is this code not taking input for “Designation”?