how to add multiple users to group in linux

C++
gpasswd -M userA,userB,userC mygroup
#if gpasswd is available on system.
Source

Also in C++: