Consider the following C function.
int fun(int n)
{
int i, j;
for (i = 1; i <= n ; i++)
{
for (j = 1; j < n; j += i)
{
printf("%d %d", i, j);
}
}
}
Time complexity of fun in terms of θ notation is:
θ(n √n)
θ(n2)
θ(n log n)
θ(n 2 log n)
This question is part of this quiz :
GATE-CS-2017 (Set 2),C Programming PYQs GATE CS,Loops & Conditionals GATE CS PYQ Quiz