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
How is the internet made?
sergey [27]

The Internet was made for shopping, searching. It was first made when the computers came out. (Windows Vista) Now you can watch videos or play games. The internet was main browsing and shopping. The internet today is really advanced and has made it was to phones and TVs. The internet wasn't the first thing you can do on the computer, you could write up a paper or do a slide show.

The Internet was created by Bob Khan and Vint Cerf. The Internet is like a big Tree. The websites are the bushes and the branches are the makers of the website. The internet today just a bunch of makers who make websites that you can access through the internet. If there were no websites there would be no internet. So if the internet quits (The Internet cant) Google and other big websites will be shut down. So the internet is a home for all the websites we use today.

This is really long but I tried not to make it so complicated and sound like I didn't copy and paste. I really hope this helped you in someway and Your Welcome. :)

8 0
3 years ago
How many transponders are contained within a typical satellite?
Ilia_Sergeevich [38]

Answer:

d.

24 to 32

Explanation:

Satellite programmers broadcast, signals to the satellite which they own or lease the channel space from. Uplinked signals sent by the programmers are received by the transponder located on satellite. It is a device which receives signals and transmits them back to Earth after converting the signals to frequency which could be received by the ground-based antenna. <u>There are typically 24 to 32 transponders on a satellite. </u>

8 0
3 years ago
An analog video is a video signal transmitted by an analog signal, captured on a (blank)
Tju [1.3M]

Answer:Analog component signals are comprised of three signals, analog R′G′B′ or YPbPr. Referred to as 480i (since there are typically 480 active scan lines per frame and they are interlaced), the frame rate is usually 29.97 Hz (30/1.001) for compatibility with (M) NTSC timing.

Explanation:

3 0
3 years ago
What two items must be passed in a tuple to the socket module's connect method in order to connect a socket? (choose two.)
Gekata [30.6K]

The amount of data that can be read from the socket in bytes at most.

<h3>What is socket?</h3>
  • Using socket endpoints on top of the operating system, the "socket" module specifies how server and client machines can communicate at the hardware level.
  • Both connection-oriented and connectionless network protocols are supported by the "socket" API.
  • Using socket endpoints on top of the operating system, the "socket" module specifies how server and client machines can communicate at the hardware level.
  • Both connection-oriented and connectionless network protocols are supported by the "socket" API.
  • An implementation of sockets in a library allows you to use them in your software for Internet communication.

To learn more about socket, refer to:

brainly.com/question/27814017

#SPJ4

6 0
1 year ago
Given the int variables x, y, and z, write a fragment of code that assigns the smallest of x, y, and z to another int variable m
Marysya12 [62]

Answer:

// here is code in C++.

#include <bits/stdc++.h>

using namespace std;

// main function

int main()

{

   // variables

   int x=5,y=2,z=9;

   int min;

   // find the smallest value and assign to min

   // if x is smallest

   if(x < y && x < z)

   // assign x to min

    min=x;

     // if y is smallest

else if(y < z)

 // assign y to min

    min=y;

// if z is smallest

else

 // assign z to min

    min=z;

// print the smallest

cout<<"smallest value is:"<<min<<endl;

return 0;

}

Explanation:

Declare and initialize variables x=5,y=2 and z=9.Then check if x is less than y and x is less than z, assign value of x to variable "min" .Else if value of y is less than value of z then smallest value is y, assign value of y to "min".Else z will be the smallest value, assign its value to "min".

Output:

smallest value is:2

6 0
3 years ago
Other questions:
  • Help me Please?!! I will put you as brainliest.<br>I hope I spelled that right.
    5·2 answers
  • Write a function addOne that adds 1 to its integer referenceparameter. The function returns nothing.
    11·1 answer
  • . public members are accessible from ________________ where the object is visible
    9·1 answer
  • What PowerShell command can be used to clean up old update files on a WSUS server, including unused update files, old revisions,
    10·1 answer
  • What is project management? A. Brainstorming ways to plan a project B. Executing, completing, and revising a project C. Managing
    10·1 answer
  • For example, consider a file with protection mode 644 (octal) contained in a directory with protection mode 730. How might the f
    9·1 answer
  • Which is the correct option?
    6·1 answer
  • What can be done to solve unemployment problem?​
    11·1 answer
  • rue or false: The first web browser was introduced to the public in the 1970s and started the explosive growth of the Internet i
    15·1 answer
  • Who is the best valorant character
    11·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!