For starters, lets indent your code so it's more readable:
#include<stdio.h>
int main()
{
int i=1,j=1;
for(i=1;i<=3;i++)
{
for(j=1;j<=3;j++)
{
printf("%d &d\n",i,j);
if(i==2 && j==2)
{
break;
}
}
return 0;
}
}
(I added the last close curly bracket for completeness)
Now you can see what happens: When you break out of the inner loop, the next code the processor sees is
return 0;
so it exits the
main
function and terminates the application.
Probably, you want the
return
at the end of the function, outside both loops.
You also need to change this:
printf("%d &d\n",i,j);
To this:
printf("%d %d\n",i,j);