write the function int countchtr(char string[],int
ch);which returns the number of timesthe character ch
appears in the string. for example the call countchtr("she
lives in Newyork",'e') would return 3.
Answer Posted / goloap
int countchtr(char *str, char ch)
{
int count=0;
char *itr = str;
while (*itr != '\0')
{
if(*itr == ch)
{
count++
}
itr++;
}
return count;
}
| Is This Answer Correct ? | 4 Yes | 0 No |
Post New Answer View All Answers
What is bash c?
Who invented b language?
What is 1f in c?
please give me a VIRTUSA sample palcement papers.... you will only send TECHNICAL SECTION..... that is help for me Advance Thanks........................
How do I round numbers?
Differentiate between functions getch() and getche().
How are variables declared in c?
FORMATTED INPUT/OUTPUT functions are a) scanf() and printf() b) gets() and puts() c) getchar() and putchar() d) all the above
Simplify the program segment if X = B then C ← true else C ← false
What is the function of this pointer?
#include
What is c method?
What is hashing in c?
Write a program of advanced Fibonacci series.
How can I make it pause before closing the program output window?