Given a string, count how many times a sequence of characters (in this code, the sequence is ei) appears until the user types '#', then print the amount. I would like to know how to improve the code.#include <stdio.h>#include <inttypes.h>int main(void){    char ch, cur_ch, last_ch;    cur_ch = '\0';    uint16_t count = 0;    puts(Enter a string (# to finish):);    while ((ch = getchar()) != '#')    {        last_ch = cur_ch;        cur_ch = ch;        if (last_ch == 'e' && cur_ch == 'i')            count++;    }    printf(There %s % PRIu16  %s.\n, count == 1 ? is : are, count,    count == 1 ? ei : ei's);    return 0;}
Print how many times a sequence of characters appears in a string
beginner;c