When coughing you can sometimes strain your muscles in your stomach and abdomen which is normal and can be the cause of the belly pain when coughing.
Sometimes I have pain in my belly when coughing and the pain goes away within 20 to 30 minutes most times.
You could also have a pulled muscle or hernia in your stomach and when you sneeze you aggravate the pulled muscle and hernia causing the pain.
If the pain goes away within 30 minutes or an hour after sneezing then it may not be anything serious.
But if the pain persists all day or your belly always hurts when you cough or sneeze then something could be wrong because sneezing or coughing should not normally cause any belly pain.
It usually takes a hard cough or hard sneeze to strain your belly muscles but it does happen from time to time.