How do I format a numbered list on multiple choice question in word - list

I have the following set of Multiple Choice Questions in word. The main question number is automatic , there is no problem here.
1. Sample Question 1
a. Answer 1 b. Answer 2
c. Answer 3 d. Answer 4
2. Sample Question 2
a. Answer 1 b. Answer 2
c. Answer 3 d. Answer 4
I have trouble setting the numbered list in the multiple choice answer.I want it to be automatic.

Related

JAVA Regex Explain [duplicate]

This question already has an answer here:
Reference - What does this regex mean?
(1 answer)
Closed 2 years ago.
[01]?\d{1,2}
can someone please explain the complete meaning of the above line.
This pattern describes a text that might (but not must) start with a 0 or 1 ([01]?) followed by one to two digits (\d{1,2}).
In short, this pattern used to test a number between 000 and 199. [01]? means a number starts with 0 or 1, and \d{1,2} means a one-digit or two-digit number.

C++ | Boolean Values, which is true? [duplicate]

This question already has answers here:
Does true equal to 1 and false equal to 0? [duplicate]
(2 answers)
Closed 4 years ago.
I recently have been reading a tuition book in C++, the question was under a chapter discussing Boolean operators. The question that confused me was as follows:
Which of the following is true?
A. 1
B. 66
C. .1
D. -1
E. All of the above
The answer itself is E according to the paper however, from a newbie perspective like myself, I assumed that A was the answer as a true value is stored as a 1 whereas a false value was stored as a 0? So why would the answer be all of the above?
Any value that is not equal to zero is considered true. So the answer to the question is E since none of the listed values are zero.

SAS Assignment Statement without even sign [closed]

Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 4 years ago.
Improve this question
I'm studying for a SAS certification exam, and I came across an unexplained behavior. Note the data step below:
data D;
A+1;
A+1;
A+1;
run;
Question 1: Why this step does not result in error?
Question 2: Why a variable A is created, and its value is 3 and not missing?
Question 3: Why when I change + for - , it results in error?
I have searched about it and i couldn't find nothing, even in SAS documentation
A+1 is sum statement initially A or anything in that form is automatically set to 0 and in your second line of code it becomes 0 +1 = 1 then this value is in A is retained that is A becomes 1 and then when you add 1 in your 3 line of code becomes 2 and then 3. There is nothing of sort is there for -, so it errors when you do A-1, becomes A is not defined, where as in A +1 A is automatically set to 0. Below is the documentation for Sum statement
http://support.sas.com/documentation/cdl/en/lrdict/64316/HTML/default/viewer.htm#a000289454.htm.
Please see in below comment of #longfish explains to do the samething for -1, you need to do A+-1
That is a SUM statement. The syntax is
variable + expression ;
That is why replacing the + with - did not work. It no longer followed the pattern above. If you want to subtract then negate the expression.
variable + - (expression) ;

How Gcd works in this code? [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 5 years ago.
Improve this question
I tried solving a question on hackerearth and i was not able to solve it so i saw editorial.They gave only code without explanation.Can u expain logic behind why gcd used here?
Question:
Scooby and all of his friends have gathered for a party. There are N friends present. Scooby is really happy to see all of his friends in one place and is excited to greet them.
All N friends are seated in a circle, and are numbered from 0 to N-1. Scooby is initially sitting beside the Ath friend. After greeting one friend, he goes clockwise to the Bth next friend, sits next to him and greets him. He repeats this till he returns to the Ath friend.
In his excitement, it is possible that Scooby misses out on greeting some friends. Your job is to find the number of friends (including A) that Scooby will have greeted before reaching back to A.
Solution given:
int main()
{
int T;
cin>>T;
while(T--)
{
long long N,A,B;
cin>>A>>B>>N;
long long g=gcd(B,N);
cout<<N/g<<endl;
}
return 0;
}
To explain the solution of the above problem I will first show that the answer is - LCM(B,N)/B and then show you how this is equal to N/GCD(B,N).
First Part-
Now assume that when it again reaches A after following the above mentioned steps he would have greeted f friends.(Note no two friends greeted through the above mentioned procedure can be same). Moreover, assume that when he reached A he would have made r rounds of the circle.
Now we can say that -
f * B = r * N = C.
Let this be equal to some constant C. Clearly C is some multiple of B and N moreover, it is the Lowest Common Multiple(LCM) of B and N(as we want to give answer as soon as it reaches for the first time).
So f = LCM(B,N)/B. Note f is the number of friends he greeted so it is the required answer.
Second Part-
For two positive integers a and b with their GCD and LCM g and l respectively, we have the following relation - a*b = g*l.
From the above relation we can say that -
LCM(B,N)*GCD(B,N) = B*N
=> LCM(B,N)/B = N/GCD(B,N)
So finally we have our answer = LCM(B,N)/B = N/GCD(B,N).

regular expressions with an asterisk (with a specific example) [duplicate]

This question already has an answer here:
Reference - What does this regex mean?
(1 answer)
Closed 6 years ago.
In general, I have a hard time understand the REs. I have been looking for good references but none has made them clear for me so far. If anyone knows good resources, let me know. I would really appreciate it.
I was going over a reading material on RE and there are several examples i havent been able to understand
..(0 or 0(1 or 11)0)*.. no occurrence of 111
I think for there to be a match, the input has to contain either 0 or 010 or 0110 or just none (sine * makes it optional)
The book says the following are matches 0110 101011000010000101 011000011 which i have no objection to because all of them contain at least either one of the three (0 or 010 or 0110 ).
However, the book says the following are false 1110 1110110111 0101011111000011.
The book claims that ..(0 or 0(1 or 11)0)*.. means no occurrence of 111 Can someone explain to me why that is?
The actual regular expression for matching a binary number which has no more than two 1s in direct sequence is:
^(0|(0(1|11)0))*$
This regex matches any number of zeroes (the first part) or any number of the following two cases: 010 or 0110. This means that the regex will only match a single 1 or pair 11 in the sequence.
You can explore this regex here:
Regex101