That program runs twice, because inside the main function you're again making a call to the function and guess what, it will never end... It will continously call the main function and pass that (useless) parameter of value 10 to it, and again print the message on the screen.
Using
main(void)
means that you're not passing any parameter at all, whereas
main(int a)
means a parameter of integer data type is required, but it doesn't cut short the number of times the hello world will print. If you want to, you can write it as,
#include <stdio.h>
int main(int x)
{
for (int i = 0; i < x; i++)
printf("Hello, World!\n");
return 0;
}
Call the main function and pass the value now. You can use the same logic, to call the main function 10 times by using a for loop and so on.