I'm learning C Programming at Uni and was given the following code to compile and try the program...
Can someone explain why the window is closing before the final line is printed and how I stop this?
printf("\a How many pets do you have?\n");
printf("So, you have %d pets! How many of these are cats?\n", pets); scanf("%d", &cats);
printf("and how many dogs?\n", dogs);
printf("So, you have %d pets of which %d are cats and %d dogs!\n", pets, cats, dogs);
Thank you for your time,