asked 18.2k views
2 votes
Without using any additional variables, and without changing the values of ndays or the elements of the parkingTickets array, write some code that results in mostTickets containing the largest value found in parkingTickets.

asked
User Shwet
by
8.3k points

1 Answer

2 votes

Answer:

Step-by-step explanation:

mostTickets=0;

for (k=0; k< ndays; k++){

if (parkingTickets[k]>mostTickets) mostTickets=parkingTickets[k];

}