Computer Science, asked by rahulg7181, 11 months ago

Maria is the sister of Ana. Ana knows her sister is in the bus terminal. She wants to find out Maria boarded on the bus or not? Ana knows Maria's ticket number and the bus company provide the ticket numbers of passengers who have boarded. Write a C program to help Ana to find if Maria boarded on the bus or not.



Constraints:



1 <= N <= 100



100 <= TN <= 1000

Answers

Answered by sunny1206
0

vwhwjsbwudhdvsusvdudhheuxhddhzsbsixidciejdid

Answered by mindfulmaisel
3

"Program to check if the ticket matches or not"

Explanation:

#include<stdio.h>

int main(){

int N;

scanf("%d", &N);

int TN[N];

for(int i=0; i<N; i++){

 scanf("%d", &TN[i]);

}

int Maria_TN;

scanf("%d", &Maria_TN);

int boarded = 0;

for(int i=0; i<N; i++){

 if(TN[i]==Maria_TN){

  boarded = 1;

  break;

 }

}

if(boarded){

 printf("boarded");

}else{

 printf("notboarded");

}

printf("\n");

return 0;

}

hence, here is the program to check if the ticket matches or not.

Similar questions