To count no. of occurence of a character in a string

Program:

#include<stdio.h>
#include<conio.h>
void main()
{
    char str[80], ch;
    int i = 0, count = 0;
    clrscr();
    printf("Enter the text : \n\n");
    gets(str);
    printf("\nEnter the character to be search : ");
    scanf("%c", &ch);
    while(str[i] != '\0')
    {
        if(ch == str[i])
        count++;
        i++;
    }
    printf("\nThe character %c appears %d times in the text", ch, count);
    getch();
}

Output:

Enter the text :
Anna University
Enter the character to be search : n
The character n appears 3 times in the text