Saturday, May 23, 2015

C++ Program to Find a latter from string

#include<conio.h>
#include<iostream.h>
#include<stdlib.h>

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";

}


Share this

0 Comment to "C++ Program to Find a latter from string "