C Puzzles

Product of All Other Array Numbers

Problem: Given an array of n integers where n>1, return an array of same size an input array where at every index of the output array should contain the product of all elements in the array except the element at the given index. Example: arr[] = {10, 4, 1, 6, 2} prod[] = {48,120,480,80,240} Solution: Read More →

Check Whether a Given Point Lies inside a Triangle or not

Given three corner points of a triangle, and one more point P. Write a function to check whether P lies within the triangle or not. The program needs to read the values of three coordinates A(x1,y1) B(x2,y2) C(x3,y3) as well as another coordinate P(x,y) and determine whether this point is inside a triangle formed from Read More →