Answer:
SEO stands for “search engine optimization.” In simple terms, it means the process of improving your site to increase its visibility for relevant searches.
SEM, or search engine marketing, is the act of using paid strategies to increase search visibility.
Answer:
The correct answer is:
C. ndx = 0;
while (ndx < 3) {
ar[ndx] = 0;
ndx++;
}
Explanation:
The declaration given is:
int ar[3];
This means the array consists of three locations and is named as ar.
We know that the indexes are used to address the locations of an array and the index starts from 0 and goes upto to 1 less than the size of the array which means the indexes of array of 3 elements will start from 0 and end at 2.
Now in the given options we are using ndx variable to run the while loop.
So the code to assign zero to all elements of array will be
ndx = 0;
while(ndx<3)
{
ar[ndx] = 0;
ndx++;
}
Hence, the correct answer is:
C. ndx = 0;
while (ndx < 3) {
ar[ndx] = 0;
ndx++;
}
Answer:
- public class Main {
-
- public static void main (String [] args) {
-
- for(int i = 1; i < 10; i++){
- int num = 0;
- num += i;
- }
- System.out.println(num);
- }
- }
Explanation:
In programming each variable has its scope. For example, a variable defined within the for loop has no longer exist outside the loop body. To illustrate this we can write a short program as presented above.
Firstly, create a for loop that traverse the number 1 - 10 (Line 5 - 8). Within the loop create a variable num and initialize it with zero (Line 6) and increment it with i value for each iteration (Line 7).
Outside the loop, we try to print the num (Line 9). When we run the program this will result in an error as the num which is declared inside the for loop will no longer exist outside the loop body.