C++ Program to Find a latter from string

#include
#include
#include

int function(char*s,char ch)
{ while(*s!=’\0′)
{
if(*s==ch)
return 1;
s++;
}
return 0;
}
void main(){
char s[]={“My name is usman”};
char ch=’w’;
if(function(s,ch)==0){
cout<<" not fount ";
}
else
cout<<"Found";

}

Published by Affairs Outline

Affairs Outline - Talking about current affairs around the glob

Leave a comment