Skip to content

Instantly share code, notes, and snippets.

@Mashpy
Created September 30, 2013 17:05
Show Gist options
  • Save Mashpy/6766871 to your computer and use it in GitHub Desktop.
Save Mashpy/6766871 to your computer and use it in GitHub Desktop.
#include <iostream>
#include <cstring>
using namespace std;
int main()
{
char *p[4]={"avc","sdf","dfs","eft"};
char ad[5];
cout << "input the book name" << endl;
cin>> ad;
int i=0;
while(i<4){
if((strcmp(ad,p[i]))==0){
cout<<"book is available in item= "<<i;
}
else
cout<<"\nbook is not available in item "<<i;
i++;
}
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment