# STAY HOME # STAY SAFE
The range of values of i in for (i = 0; i<n; i++) if [0, n-1].
Option 1 :
for(i = n-1; i>=0; i--)
In this loop thr value of i starts from n-1 and decrements till 0 .
=> Therefore,the range of values of i is [0, n-1].
=> This option is correct.
Option 2 :
for(i = n-1; i>=0; i--)
In this loop thr value of i starts from n-1 and decrements till 0 .
=> Therefore,the range of values of i is [0, n-1].
=> This option is correct.
Option 3 :
for(i = n; i>=0; i--)
In this loop thr value of i starts from n and decrements till 0 .
=> Therefore,the range of values of i is [0, n].
=> This option is incorrect.
Option 4 :
for(i = n-1 ; i>0; i--)
In this loop thr value of i starts from n-1 and decrements till 1 .
=> Therefore,the range of values of i is [1, n-1].
=> This option is incorrect.
Which for loop has range of similar indexes of 'i' used in: for (i =0; i<n;...
5.2 How many times this for loop will execute? for (i = 0; i <= 100; i++) ANN cout<<i+8<<endl; WA Am } Answer:
(3 marks) Write exactly one for loop whose start condition is int i = 0; and whose end condition is i<n; such that your code fragment has a time complexity of O(n?). (3 marks) Write exactly three for loops that are nested inside of each other whose start conditions are int i = 0;, int j = 0;, and int k = 0;, respectively, and whose end conditions are i<n; j<n;, and k < n;, respectively, such that your code...
Assume that n is 5 and k is 2. Which of the Boolean expressions are true? 0! (0 <= n && n <= k) n >= 0 && k > 0 05 < n && n < k || k < 10 0 <= n || n < k ! (n <= 5) O 0 <= k <n
what are the answers
Which detects if x is in the range -4 to +4? (x < -5) AND (* < 5) O (x >-5) AND (* < 5) O (X <-5) OR (x < 5) O (x > -5) OR (* < 5) If the final else branch executes, what must userNum have been? Type "unknown" if appropriate. if (userNum < 9) { > else if (userNum > 11) -- > else { ... // userNum if this executes...
In [19]: System.out.printf("%3s%85\n", "Day", "Index"); System.out.printf("===========\n"); for (int i = 0; i < days.length; i++) { System.out.printf("%35%8d\n", days[i], i); Day Index sun mon tue wed & ! Om to thu fri sat CODING CHALLENGE 02 Copy the code above into the main function of a Java program named DaysArray.java and change the for loop to a while loop.
#include<stdio.h> eint main() { int i = 0, j = 0; while (i < 10|| j < 7) { i++; j++; } printf("%d, %d\n", i, j); getchar(); return 0; } 01,01 10,10 7.7 10,7
- 2 + x - 2 < 0 has no solutions. True False
1 4.6.3. (Harder!) Let 0 < a < 1. Prove that for any n EN, (1 – a)” < 1+n·a
Solve the inequality 22 +2 - 2 22 - 5.0 + 6 <0
Find Fourier series of f(x)= 0 if -35 x<0 and f(x)= 1 if 0 < x <3 which f(x) is defined on [-3,3)