Cricket team

QUESTION

A cricket team contains 8 players .Find a player name Mohan appear more than twice or not in an unordered name list.

ANSWER

#include <iostream>
#include <string.h>
using namespace std;
int main()
{
  int k=0;
 char n[16][20];
  for(int i=0;i<16;i++)
  {
    cin>>n[i];
   if(strcmp(n[i],"mohan")==0)
     k=1;
  }
  if(k==1)
    cout<<"mohan appears once in the list";
else
cout<<"mohan not appears in the list";

  return 0;
}
  
Ads Blocker Image Powered by Code Help Pro

Ads Blocker Detected!!!

We have detected that you are using extensions to block ads. Please support us by disabling these ads blocker.

Powered By
Best Wordpress Adblock Detecting Plugin | CHP Adblock