Answer:
#include <math.h>
#include <stdio.h>
#include <string.h>
#define BASE 3
#define NRQUESTIONS 15
void toABC(int n, char* buf, int base, int size) {
memset(buf, 'A', size);
buf[size] = 0;
while (n && size) {
buf[--size] = 'A' + (n % base);
n /= base;
}
}
int main()
{
char buf[16];
for (int i = 0; i < pow(BASE, NRQUESTIONS); i++) {
toABC(i, buf, BASE, NRQUESTIONS);
printf("%s\n", buf);
}
}
Explanation:
Assuming 3 is the number of possible answers to choose from for each question.
I tackled this by having an integer counter enumerate all values from 0 to 3^15, and then convert each integer to a base-3 representation, using ABC in stead of 012.
Answer:
Syntax error on line 7 since missing quotes around the strin
Answer:
0.03
Explanation:
3e-2 is in scientific notation, also known as standard form. Used to write large or small numbers in another way. In the number 3e-2, the numbers are defined as follows:
3 = coefficient
e = 10 to the power of
-2 = exponent
The scientific notation 3e-2 is same as 3 x 10^-2 or 3 x 10-2. Thus, to get the answer to 3e-2 as a decimal, we multiply 3 by 10 to the power of -2.
= 3e-2
= 3 × 10-2
= 0.03