Lets write a C program to enter number till the user wants. At the end it should display the count…