Post Top Ad

Your Ad Spot

Pages

Thursday, 6 February 2020

Search Given Character Present In String By C language

#include<stdio.h>
#include<conio.h>

int CharSearch(char*s,char c)
{
     int i;
         for(i=0;s[i]!='\0';i++)
           {   
              if(s[i]==c)
              return 1;
           }
                return 0;
}

void main()
{  char ch='B';
   clrscr();
   if(CharSearch("VAIBHAV",ch))
     {
         printf("SUCCESFULLY FOUND%c",ch);
      }
getch();
}

No comments:

Post a Comment

Post Top Ad

Your Ad Spot

Pages