Type the Question

Saturday, February 16, 2019

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

1 comment:

Question Name:TOWER OF HANOI

#include < bits / stdc ++. h > #define lli long long using namespace std ; lli dp [ 202 ]; int main () { int t , n ; ...