Question 11
Question 12
Question 13
Question 14
bool fun(int n)
{
int sum = 0;
for (int odd = 1; n > sum; odd = odd+2)
sum = sum + odd;
return (n == sum);
}
Question 15
int MyX(int *E, unsigned int size)
{
int Y = 0;
int Z;
int i, j, k;
for(i = 0; i < size; i++)
Y = Y + E[i];
for(i = 0; i < size; i++)
for(j = i; j < size; j++)
{
Z = 0;
for(k = i; k <= j; k++)
Z = Z + E[k];
if (Z > Y)
Y = Z;
}
return Y;
}
Question 16
Question 17
Question 18
Task T1 T2 T3 T4 T5 T6 T7 T8 T9 Profit 15 20 30 18 18 10 23 16 25 Deadline 7 2 5 3 4 5 2 7 3Are all tasks completed in the schedule that gives maximum profit?
Question 19
Task T1 T2 T3 T4 T5 T6 T7 T8 T9 Profit 15 20 30 18 18 10 23 16 25 Deadline 7 2 5 3 4 5 2 7 3What is the maximum profit earned?
Question 20
int n, rev;
rev = 0;
while (n > 0)
{
rev = rev*10 + n%10;
n = n/10;
}
There are 49 questions to complete.