Examples of Big | C ++ program to illustrate time complexity for single for - loop ; Driver Code ; This loop runs for N time ; This loop runs for M time
#include <bits/stdc++.h> NEW_LINE using namespace std ; int main ( ) { int a = 0 , b = 0 ; int N = 4 , M = 4 ; for ( int i = 0 ; i < N ; i ++ ) { a = a + 10 ; } for ( int i = 0 ; i < M ; i ++ ) { b = b + 40 ; } cout << a << ' ▁ ' << b ; return 0 ; }