Skip to content

Conversation

@Nathh17
Copy link

@Nathh17 Nathh17 commented Nov 3, 2025

No description provided.

if(contains(N, 10, toFind))
cout << "The number " << toFind << " is present in the array" << endl;
else
cout << "The number " << toFind << "is NOT present in the array" << endl;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

le due righe dentro l'if e l'else sono praticamente identiche, potrsti ridurre la ridondanza di codice nel seguente modo:

cout << "The number " << toFind << "is " << contains(N, 10, toFind) ? "" : "NOT " << "present in the array" << endl;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants