Examples of Big | Java program to illustrate time complexity for single for - loop ; Driver Code ; This loop runs for N time ; This loop runs for M time
class GFG { public static void main ( String [ ] args ) { 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 ; } System . out . print ( a + " ▁ " + b ) ; } }