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
dusya [7]
3 years ago
7

1. Create an optimized function "print s(n,s)" that prints the given argument s (representing a string) k times. k represents th

e number of iterations of the inner loop. The print statement that prints s is in the inner loop of the function (a) Initial conditions: i = 1, j = 1, i <= n, and j <= i (b) i and j increments: i = i + 1 and j = j ∗ 2 (c) input as arguments in the function: n (an integer representing the size of the input), and s (the string) (d) output: print s k times (e) example: n=5, s="hello CSC510-01 class", given these conditions, the function "print s(n,s)" will print s 11 times
Computers and Technology
1 answer:
lukranit [14]3 years ago
3 0

Answer:

The program in C is as follows:

void prints(char arr[], int n){

   int count =0;

   for(int i=1 ;i<=n; i++){

   for(int j=1;j<=i; j=j*2){

   count++;    }    }  

   for(int i =0;i<count;i++){

       printf("%s ",arr);

   }

}

Explanation:

This defines the method

void prints(char arr[], int n){

This declares and initializes count variable to 0

   int count =0;

This creates the outer loop

   for(int i=1 ;i<=n; i++){

This creates the inner loop

   for(int j=1;j<=i; j=j*2){

This increments count by 1

   count++;    }    }  

This iterates through count

   for(int i =0;i<count;i++){

And print the string in count times. If count is 3, the string will be printed 3 times.

       printf("%s ",arr);

   }

}

See attachment for complete program that includes the main method

Download txt
You might be interested in
As part of its commitment to sustainability, a company is looking for a way to track the source of purchased goods and how they
luda_lava [24]

The primary technology that would enable the company to achieve this goal is Blockchain technology

  • Blockchain is commonly defined as an enclosed, encrypted, distributed database that is distributee in a wide range of multiple computers or nodes that are part of a community or system.

  • It is an exciting technologies as it helps to limit the incidence of security breaches by even its own users.

  • With Blockchain, a company can be able to guard against thefts of their products and also monitor them.

From the above we can therefore say that the answer to The primary technology that would enable the company to achieve this goal is Blockchain technology is correct

Learn more from:

brainly.com/question/24875333

6 0
3 years ago
Read 2 more answers
Which trait can be a positive or negative?
N76 [4]

Answer:

Prejudice can be either positive or negative.

4 0
3 years ago
What is the difference between password protection and encryption? please answer quick, i cant pass this test for the life of me
sergiy2304 [10]

Answer:Password protection is like locking something in a safe-deposit. It means no one can get to the locked content without knowing the right combination. This method is used on separate documents, folders, and other data the computer's user may want to protect from other people who might have access to the device. The problem is, if someone interested in such content obtains the password or finds a way to open it without it, the content might be revealed despite the owner's efforts to keep it hidden. Unfortunately, there are a lot of ways hackers could obtain the password or hack in without it. For example, it could be obtained with the help of malware, or it might be guessed if the user chooses a weak password. Not to mention, when it comes to PDF documents, the passwords placed on them can be removed using the CMD window or specific.

Password encryption is a step up from password protection. The term can be a tad confusing because, in fact, you cannot encrypt the password itself. Instead, by setting up "password encryption" you are creating a password AND encrypting the contents of the file. In our example (see instructions below), the contents of the user's PDF document are not only password protected, but also encrypted. It is a process during which the content one wishes to keep secret is altered to make it unrecognizable. For example, if it is a text document, letters of each word might be shuffled with additional characters so the words would no longer make any sense. The reverse process is only available if the person who wants to decrypt this data can provide a specific decryption key or a password. In other words, even if the password is removed no one could read the hidden content as it still would need to be decrypted. Of course, it is important to realize you might be unable to retrieve it too if you lose the decryption key, aka, the password.



PLS MARK ME AS BRAINLIEST.

3 0
2 years ago
If a device does not require a driver, it is _____.
xxTIMURxx [149]

Answer:

(B) plug and play

Explanation:

If a device does not require a driver, it is <u>plug and play</u>. Plug and Play (PnP) is a combination of hardware and software support that enables a computer system to recognize and adapt to hardware configuration changes with little or no intervention by a user, including the loading of appropriate drivers.

7 0
4 years ago
What does ascii stand for?
tamaranim1 [39]
ASCII—American Standard Code for Information Interchange
7 0
3 years ago
Read 2 more answers
Other questions:
  • Which of the following steps in enumeration penetration testing extracts information about encryption and hashing algorithms, au
    13·1 answer
  • For the MIPS assembly instructions below, what is the corresponding C statement? Assume that the variables f, g, h, i, and j are
    15·2 answers
  • Word processing programs have different view options that you can use depending on the tasks you’re performing. Which option hel
    11·1 answer
  • ____ are model building techniques where computers examine many potential solutions to a problem, iteratively modifying various
    5·1 answer
  • Which of the following is NOT part of the Ethernet standards? O 1.802.3 O 2.802.2 O 3 LLC O4 pPp
    12·1 answer
  • Which two pieces of information must be provided when saving a file for the first time in Wordpad?____.
    8·1 answer
  • What should I do if I pluged in my computer charger and it starts making noise and sounds? Plz tell me. Will mark as brainliest
    6·1 answer
  • Why is printer an output device​
    14·2 answers
  • URGENT: I need to add a while loop in this program but I don't know-how. I am also having trouble neatening some lines of code.
    15·1 answer
  • Who does online school on FLVS???????????????????
    9·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!