Thursday, 24 January 2013

Searcher

// finder.cpp : Defines the entry point for the console application.
//

#include "stdafx.h"
#include <iostream>
#include <string>
using namespace std;

int counter = 0;
int main()
{
    string names[5]= {"ali", "ateeq" , "shani", "jani", "azeem"};
    string geter;
    string user;
    cout << "enter name" << endl;
    cin >> user;
   
    for(int j=0; j<=4; j++)
    { geter=names[1];
   
        counter = user.length();
    for(int i=0; i<=user.length(); i++)
    {

           

        if(geter[i]==user[i])
        {
             counter--;
       
          if (counter ==0)
          {cout << geter;}
       
        }
           
           
       
       
   
    }
   
   
   
   
}
    system ("pause");
    return 0;
}

0 comments:

Post a Comment

Twitter Delicious Facebook Digg Stumbleupon Favorites More

 
Design by Free WordPress Themes | Bloggerized by Lasantha - Premium Blogger Themes | Enterprise Project Management