
262 Programming and Data Structures
/ * pointer cbp, i f given character ie not found strchrO returns n ull. */
clrscrO;
printf ("Enter Text Below
gets(string);
printf ("\nCharacter to fin d :");
ch=getcharO;
chpsstrchristring,ch);
if(chp)
printf ("Character %c found in string.",ch);
else
printf ("Character % c not found in string.",ch);
OUTPUT;
Enter Text Below: Hello Beginners.
Character to fin d: r
Character r found in string.
OR
8.24 Write a program to find first occurrence of a given character in a given string. Find the
memoty location where the character occurs. Use strchrO function.
#include <stdio.h>
#include <string.h>
#include <conio.h> ...