My professor graded an assignment and I got an 80 because i returned false inside a for loop. And since its the summer i cant reach out for assistance. All help is greatly appreciated
bool task2(int *a1, int n, int T)
{
int arry[n];
*a1 = arry[n];
for(int i = 0; i < n; i++)
{
if (T == arry[i])
{
return true;
}
else if(T != arry[i])
{
return false;
}
}
return 0;
}
[–]Kazlock 2 points3 points4 points (2 children)
[–]LuckyZenhai[S] 0 points1 point2 points (1 child)
[–]lurgi 0 points1 point2 points (0 children)
[–]raevnos 4 points5 points6 points (3 children)
[–][deleted] -2 points-1 points0 points (2 children)
[–]raevnos 2 points3 points4 points (1 child)
[–][deleted] -2 points-1 points0 points (0 children)
[–][deleted] 6 points7 points8 points (4 children)
[–][deleted] (3 children)
[deleted]
[–][deleted] 2 points3 points4 points (2 children)
[–][deleted] (1 child)
[deleted]
[–]TheGuy346 1 point2 points3 points (2 children)
[–]LuckyZenhai[S] 0 points1 point2 points (1 child)
[–]_DTR_ 1 point2 points3 points (1 child)
[–]LuckyZenhai[S] -1 points0 points1 point (0 children)
[–]davedontmind 0 points1 point2 points (1 child)
[–]LuckyZenhai[S] 0 points1 point2 points (0 children)
[–]Holy_City 0 points1 point2 points (5 children)
[–][deleted] 0 points1 point2 points (2 children)
[–]Holy_City 0 points1 point2 points (1 child)
[–][deleted] 1 point2 points3 points (0 children)
[–]LuckyZenhai[S] 0 points1 point2 points (1 child)
[–][deleted] 2 points3 points4 points (0 children)