Is this code for pythagorean triplet correct?
Hey Divyam, your this code will not work as its time complexity is O(N^2) where N =10^9 which is a very large number. So, think a lil bit more on this and try to derive some formula for finding the triplets. Also you can’t store that big numbers as int data type so change the data type to long long int.
Hi Divyam, the question says that you need to print pythagoras triplet in increasing order. When we enter 5 as input, your code gives 3 and 4. So you might need to work upon your logic.