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
Ad libitum [116K]
2 years ago
8

Print numbers 0, 1, 2, ..., userNum as shown, with each number indented by that number of spaces. For each printed line, print t

he leading spaces, then the number, and then a newline. Hint: Use i and j as loop variables (initialize i and j explicitly). Note: Avoid any other spaces like spaces after the printed number. Ex: userNum = 3 prints:
0
1
2
3
(each number is one tab over from the last but formatting on Brainly wont allow that)


#include


int main(void) {

int userNum;

int i;

int j;


scanf("%d", &userNum);


/* Your solution goes here */


return 0;

}
Computers and Technology
1 answer:
geniusboy [140]2 years ago
8 0

Answer:

Please find the answer below

Explanation:

// Online C compiler to run C program online

#include <stdio.h>

int main() {

   // Write C code here

   //printf("Hello world");

   int userNum;

   int i;

   int j;

   

   scanf("%d", &userNum);

   /* Your solution goes here */

   for(i = 0; i<=userNum; i++){

       for(j = 0; j <= i; j++){

           printf(" ");

       }

       printf("%d\n", i);

   }

   return 0;

}

You might be interested in
Activities provided for the satisfaction of others and consumed at the time of purchase<br> are…
Natasha2012 [34]
The answer is services
6 0
2 years ago
#Write a function called find_median. find_median #should take as input a string representing a filename. #The file correspondin
azamat

Answer:

Explanation:

The following is written in Python. It takes in a file, it then reads all of the elements in the file and adds them to a list called myList. Then it sorts the list and uses the elements in that list to calculate the median. Once the median is calculated it returns it to the user. The code has been tested and the output can be seen in the image below.

def find_median(file):

   file = open(file, 'r')

   mylist = []

   for number in file:

       mylist.append(int(number))

   numOfElements = len(mylist)

   mylist.sort()

   print(mylist)

   if numOfElements % 2 == 0:

       m1 = numOfElements / 2

       m2 = (numOfElements / 2) + 1

       m1 = int(m1) - 1

       m2 = int(m2) - 1

       median = (mylist[m1] + mylist[m2]) / 2

   else:

       m = (numOfElements + 1) / 2

       m = int(m) - 1

       median = mylist[m]

   return median

print("Median: " + str(find_median('file1.txt')))

5 0
3 years ago
A network engineer executes the following command sequence (-i specifies the TTL of the ICMP packet sent):
harkovskaia [24]

The correct option is D. tracert; This sequence emulates is utilities for the command sequence.

<h3>Explain the term command sequence?</h3>

We can complete operations that need numerous phases thanks to sequence, which refers to the order in which commands are processed by a computer.

  • Sequence is indeed a basic algorithm in programming: a series of sequentially carried out logical steps.
  • Network engineers create and implement network setups, address performance issues, monitor networks, and set up firewalls and other security measures.
  • By delivering Internet Control Message Protocol (ICMP) is  echo packet to a target, the TRACERT diagnostic tool ascertains the path to the location.

Thus,  utilities is emulated by this sequence is TRACERT .

To know more about the command sequence, here

brainly.com/question/27703743

#SPJ4

3 0
1 year ago
BIOS has two jobs. One is to boot up, or start, the computer. What is the other? Maintain the computer’s software firewall. Ensu
Levart [38]

Answer:

Provide the basic interface for the hardware.

Explanation:

3 0
3 years ago
Subtract 01101011-00101010
White raven [17]

Answer:

Alexa says minus 8

Explanation:

8 0
3 years ago
Read 2 more answers
Other questions:
  • how do you make a circuit so 1 switch will turn on/off all the lights(3 lights) and a second switch will change the lights from
    14·2 answers
  • Businesses use a fax cover sheet is to _____. provide detailed service and product information make sure message reaches the rig
    14·2 answers
  • What data unit is encapsulated inside a packet?
    5·2 answers
  • Which statement best describes the cut and paste option in a word processor?
    6·2 answers
  • Assume that we have an application with a total of 500,000 instructions where 20% of them are the load/store instructions with a
    14·1 answer
  • Type the correct answer in the box.
    5·1 answer
  • Polymorphism means ______________.
    15·2 answers
  • A ______ is a portable device for recording audio and video.
    10·2 answers
  • FILL IN THE BLANK.
    10·1 answer
  • When you insert a new slide in a presentation, where is it placed in relation to the existing slides?.
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!