Professional Documents
Culture Documents
Lab Assignment-1
Write a C++ Program to find a triplet such that sum of two equals to the third element.
Code:
#include <bits/stdc++.h>
#include <chrono>
using namespace std;
using namespace std::chrono;
void findtriplets(int arr[], int n)
{
sort(arr, arr + n);
for (int j = n - 1; j >= 0; j--)
{
int i = 0;
int k = j - 1;
while (i < k)
{
return 0;
}
Output:
Lab Assignment-2
return 0;
}