SAP Interview Question

I was asked to write algorithm for finding right angled triangle , Code snippets from java.