Without changing the code, all you can do is ask the system administrator to increase the number of allowed per-process shared memory segments.
>> would request you to give me some solution for this
As I mentioned in the 2nd post, this can be fixed by using a single shared memory segment for all shared data. That means you call shmget() and shmat() only once. Then use that one block of shared memory for all your needs.
gg