main() // Beginnig of the main block
{
int i =0,n =0; // initialiazation
int count = 0;
printf("Enter the n value\n");
scanf("%d",&n);// Takes input from user
for(i=1;i <=n; i++) // Beginning of the FOR
{
if (n % i == 0)
{
count++;
}
} // End of For
if (count == 2)
{
for (i = 1; i<= 10; i++)
{
printf("\t%d * %d = %d\n",(n*n), i, n*n*i);
}
}
else
{
for (i = 1; i<= 10; i++)
{
printf("\t%d\n",n *i);
}
}
} // End of the main block
******************************OR***********************************
#include
main() // Beginnig of the main block
{
int i=0,n=0; // initialiazation
printf("Enter the n value:");
scanf("%d",&n);// Takes input from user
for (i=1;i<=10;i++) // Beginning of the FOR
{
printf("%d * %d = %d\n",n,i,n*i);
} // End of For
} // End of the main block