MCPcopy Create free account
hub / github.com/codemistic/Data-Structures-and-Algorithms / exp

Function exp

CPP/array-2d/find_triplet.cpp:4–16  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2#include<iostream>
3using namespace std;
4void exp(int arr[],int n,int target){
5 for(int i=0;i<n;i++){
6 for(int j=0;j<n;j++){
7 for(int k=0;k<n;k++){
8 if(arr[i]+arr[j]+arr[k]==target){
9 if(arr[i]<arr[j]&&arr[j]<arr[k]){
10 cout<<"("<<arr[i]<<","<<arr[j]<<","<<arr[k]<<")"<<endl;
11 }
12 }
13 }
14 }
15 }
16}
17int main(){
18 int arr[]={2,7,4,0,9,5,1,3};
19 int n=sizeof(arr)/sizeof(arr[0]);

Callers 1

mainFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected