Unable to understand nested loop

Hello everyone,
I am totally new to c++ . I am trying to learn it by reading a book. I have done 'for loop', 'while loop', and to some extent 'do while loop' but I am not getting the 'nested loop'.

There is a program given in the book but explanation of each line is not given. This program is for finding out all prime numbers below .I am writing the program as given in the book below:

#include<iosteam.h>
#include<conio.h>
#include<math.h>
#include<iomanip.h>
void main()
{
int a,c,k,m;
cout << 2;
for (a=; a<100; a++)
{
c=1;
m= sqrt (a);
for (k=2; k<=m; k++)
if (a%k==0)
c=0;
if (c==1)
cout << setw (3) <<a;
}
getch();
}

If anybody could explain me from line 9 to 17, this will be very helpful to me.

Thank You.
Topic archived. No new replies allowed.