Question Name:Namelist

#include <stdio.h>
#include<string.h>
int main()
{
char name[10][20];
  long num[10];
  int count=0,i;
  for(i=0;i<10;i++)
  {
    scanf("%s",&name[i][20]);
    scanf("%lu",&num[i]);
    if(num[i]==103101)
      count++;
  }
  if(count)
    printf("Student register number 103101 is exist");
  else
    printf("Student register number 103101 is not exist");
	return 0;
}
  • Problem Description

    HoD have to find the name having registration number 103101 in the final year name list. Names will be in alphabetical order, HoD have to check each and every name in the name list to identify the particular registration number.

  • Test Case 1

    Input (stdin)

    Thomas 101010
    Imran 101015
    Sithik 101025
    Setan 101024
    Milton 101045
    Arjun 101084
    Rakesh 103101
    Hrithik 101036
    Ayush 101052
    Aswathy 101087
    

    Expected Output

    Student register number 103101 is exist
  • Test Case 2

    Input (stdin)

    Kavi 101010
    Imran 101015
    Chandu 101025
    Navin 101024
    Milton 101045
    Arjun 101084
    Mukil 1010023
    Hrithik 101036
    Ayush 101052
    Aswathy 101087
    

    Expected Output

    Student register number 103101 is not exist

Leave a Reply

Your email address will not be published. Required fields are marked *

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
CHP Adblock Detector Plugin | Codehelppro