Created
July 14, 2013 07:21
-
-
Save shaina7837/5993493 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <string.h> | |
using namespace std; | |
main() | |
{ | |
char *p[6] = {"paper", "pen", "pencil", "book"}; | |
char *str; | |
cout << "enter what you want to purchase? " << endl; | |
cin >> str; | |
for (int i = 0; i < 4; i++) | |
{ | |
if(strcmp(*str, *p[i])==0) | |
{ | |
cout << "Available " << endl; | |
break; } | |
if(i == 4) | |
{ | |
cout << "NOT " << endl; } | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment