Inscribed Square and Triangle

This is a companion discussion topic for the original entry at

where is the picture regarding the problem???

download (1)

DO we need to print an integer output or float?

@Aritra15 as they asked for area ,that can be both int or float. so better use double data type for precision