Program to find total number of edges in a Complete Graph | C ++ implementation to find the number of edges in a complete graph ; Function to find the total number of edges in a complete graph with N vertices ; Driver Code
#include <bits/stdc++.h> NEW_LINE using namespace std ; int totEdge ( int n ) { int result = 0 ; result = ( n * ( n - 1 ) ) / 2 ; return result ; } int main ( ) { int n = 6 ; cout << totEdge ( n ) ; return 0 ; }