Answer:
word = input('Enter a single word: ', 's');
n = length(word);
nodupWord = [];
for i = 1:n
dup = false;
c = word(i);
for j = 1:i-1
if word(j) == c
dup = true;
break;
end
end
if ~dup
nodupWord = [nodupWord, c]; %add the non-duplicate char to end
end
end
disp(['Adjusted word: ', nodupWord])
Explanation:
The code is in Python.
Answer:
Control H is the command to Find and Replace. It is used to find a word and replace the word with something else.
Explanation:
Answer:
Option (d) is correct.
Explanation:
In java language "ar.length" is used to tells the size of the array. The array is used to declare more than one variable. Its index value is started from 0. so when a user needs to initialize the value of an array, they need to start the index value at 0. because ar[0] indicates the first variable of an array.
In option (d), index value is started from 0 and ends with (array_size-1). so it gives the accessed to all the variable of an array and the statement "ar[i]=4;", initialize the value 4 to all array variable.
while another option is not valid because--
- In option a, Index value starts from 1 which accesses the second variable of an array.
- In option b, the statement "i<= ar.length;", gives an unbound array exception because it took the size greater than the array size.
- In option c, statement "i<ar.length-1;", can not give accessed to the last element of an array.
Sr.No Loop Type & Description
2 for-do loop Executes a sequence of statements multiple times and abbreviates the code that manages the loop variable.
3 repeat-until loop Like a while statement, except that it tests the condition at the end of the loop body. (HOPE THIS HELPS!!)