Chosen Solution

front camera is working and not rear one it comes black screen when i open it and same camera is working on other phone.

Deepak, use a magnifying glass to look at the back camera connector on the board, and around it. Do you see anything missing, torn, damaged, corroded? If you do see something damaged/missing, it needs to be replaced/repaired. If not, clean the connector with a cotton swab dipped in 90%+ isopropyl alcohol, reseat the camera, reboot your iPhone like craigad24 suggested, and try the camera again. let us know what happens.

Try closing the camera app completely. Double tap the home button and then slide to close app. Then try re-opening the app. If that doesn’t work try resetting the phone by holding down the home button and wake/sleep button on the top for about 10-20 seconds.