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
stira [4]
3 years ago
5

In C language. Print numbers 0, 1, 2, ..., userNum as shown, with each number indented by that number of spaces. For each printe

d line, print the
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:
Computers and Technology
1 answer:
Murrr4er [49]3 years ago
6 0

The program uses loops to print the numbers from 0 to the user input.

It also uses loops to print the indented space before each iteration value.

The program in C where comments are used to explain each line is as follows:

#include <stdio.h>

int main(){

<em>    //This declares userNum as integer</em>

   int userNum;

<em>    //This gets input for userNum from the user</em>

   scanf("%d",&userNum);

<em>    //This iterates through from 0 to userNum</em>

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

<em>    //This iterates from 0 to current iteration value</em>

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

<em>    //This prints the indents</em>

           printf(" ");         }

<em>    //This prints the current iteration value</em>

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

}<em>//The program ends here</em>

<em />

At the end of the program, the program outputs the indent, followed by the iteration value and a new line.

See attachment for the program sample run

Read more about loops at:

brainly.com/question/21751160

You might be interested in
All of these (except the ______) go unnoticed by the computer
astra-53 [7]
VIRUS I SERIOUSLY DONT KNOW THOUGH

5 0
3 years ago
For each of the following SQL queries, for each relation involved,list the attributes that must be examined to compute the answe
Vlada [557]

Answer:

1. E.eid ,E.hobby, E.sal, E.did

2.E.eid , E.sal, E.hobby ,E.did , D.did, D.floor ,D.dname , D.budget.

3.E.eid , E.sal, E.hobby ,E.did , D.did, D.floor ,D.dname , D.budget.

4.E.eid , D.dname

Explanation:

The attributes that are examined for the query are the attributes of the table that are mentioned in the select statement and where clause.

So according to first query we are working on all attribues of Emp table so all of the attributes of Emp table are examined.In second query we selecting all attributes of both the tables hence all attributes of both the table and same in the next query.

In fourth query though the query is not complete where clause is missing but we have eid from Emp and dname from Dept tables for sure and the attributes mentioned in where clause will also be present.

7 0
3 years ago
If we were to replicate Dr. Stanley Milgram's obedience study today, do you think the results would be different?
Montano1993 [528]

Answer:

Explanation:

The results would be exactly the same. We have learned little about authority and when to oppose it.

I'll give you an example. Last night I was in a restaurant like Taco Bell or Subway. Across from me was a girl with an ordinary backpack which was all I could see. It was quite common to see that in the University District where I was. I paid no attention until two policemen came in (both over 200 pounds -- she was tall but could not have been more than 130) and began arrest procedures. She started shouting very foul language but otherwise did not resist. They put handcuffs on her wrists which were behind her back. Again she she  used profane language only screaming that they were hurting her. It took the one police officers a moment to find his key and loosen the cuffs, which he did, but she was still uncomfortable and cursing.  

She was silent as they took her out. Nobody questioned the incident at all. Do you think Dr. Millgram would recognize this as an example of his theory? I'm sure he would. Trust me, this was not staged. There was a 3rd officer who drove the girl and one of the 2 arresting officers away.

7 0
3 years ago
The technology Herman Hollerith created in the 1880s began the modern-day data processing function in computers.
ololo11 [35]

Answer:

punched-card machine

Explanation:

We know this as the punched-card machine, and it is also known as the Hollerith cards or the IBM cards. At that time, and through this technology, we used to punch a hole with hand or with the machine, and each hole used to represent the data and the instruction. And these were widely used for inputting the data in the early computers.

6 0
3 years ago
The line of code to the right will import the NumPy library. The "np" is an assigned name for the library.
mario62 [17]

Answer:

a. that is may become the signal

6 0
2 years ago
Other questions:
  • Digital art is created by using __?
    5·1 answer
  • Witch of the following is a valid why a scientist might a scientific theory
    13·1 answer
  • What should be done with statements or sections which are unclear?
    12·2 answers
  • Select the correct answer.
    6·2 answers
  • What is it called to persist in trying to multitask can result in this; the scattering bits of one’s attention among a number of
    9·1 answer
  • What is the reasoning you would write an inquiry to a company?
    5·2 answers
  • Write down a pair of integers whose sum is​ 0
    5·1 answer
  • Who watches the show gravity falls, if you do, if you play the theme song for the first episode backwards you get a hiding messi
    11·2 answers
  • When using bits to represent fractions of a number, can you make all possible fractions?
    9·1 answer
  • Tamika has received an average of 97% on all of her math tests, has done well on her homework assignments, and participates in c
    9·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!