1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
koban [17]
2 years ago
12

Write a c program to print all possible marking schemes of 15 questions each with 3.

Computers and Technology
1 answer:
andrey2020 [161]2 years ago
3 0

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.

You might be interested in
What is the command to disable any Processes in linix??
stiks02 [169]

Answer: killall[process_name]  or kill[PID]

Explanation:

Killall is a tool for disabling running processes on the system. It will disable all programs that matches the name mentioned.

kill disables processes based on process id numbers. it does not disable the process directly. The process recieves a signal where the process will follow instructions which it has to follow if it receives the signal.

7 0
2 years ago
An individualized course plan for the 4 years of
spin [16.1K]

Answer:

.....

Explanation:

8 0
2 years ago
Read 2 more answers
Knowledge Spark, a school with no current job openings, wants to change to a completely virtual environment and offer classes to
Sedaia [141]

Answer:

AMONG

Explanation:

US

6 0
3 years ago
Which tool helps a project manager identify the task that have been completed and the ones that are still outstanding
vodka [1.7K]

Answer:

timeline please make me branliest

4 0
2 years ago
true or false if you type too much text on a powerpoint slide, the additional text is added to a second slide
Nady [450]
True I've had it happen alot
3 0
3 years ago
Read 2 more answers
Other questions:
  • In a word processor, Tariq chooses Options from the Tools menu and then selects the Track Changes tab. Which of the following ta
    14·1 answer
  • All of the following are qualities of an aprenticeship except
    12·1 answer
  • Which presenter would most likely benefit from a custom slide show?
    10·2 answers
  • Jeff is a financial assistant. He needs to create a document for his client that tracks her stocks and calculates the loss or ga
    10·2 answers
  • Which system utility can you use to troubleshoot a computer that's slow to start by enabling or disabling startup programs?
    7·2 answers
  • Why is weather forecast so important for hang gliders?
    12·1 answer
  • Which of the following is a good way to improve your credit score?
    5·1 answer
  • Write a function SwapArrayEnds() that swaps the first and last elements of the function's array parameter.
    6·1 answer
  • You are a librarian! Ask the user for the last names of the authors of the five books they are returning. Print a list of those
    15·1 answer
  • The name for the instructions you write to a computer in a program
    7·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!