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
Dominik [7]
2 years ago
6

In the following shell scripting extract, the initial values of variables s, c and p are 0, 1, 1 respectively. What will be the

final value of s, at the end of the while loop?

Computers and Technology
1 answer:
____ [38]2 years ago
3 0

Answer:

The first example simply counts the number of lines in an input file. It does so by iterating over all lines of a file using a while loop, performing a read operation in the loop header. While there is a line to process, the loop body will be executed in this case simply increasing a counter by ((counter++)). Additionally the current line is written into a file, whose name is specified by the variable file, by echoing the value of the variable line and redirecting the standard output of the variable to $file. the current line to file. The latter is not needed for the line count, of course, but demonstrates how to check for success of an operation: the special variable $? will contain the return code from the previous command (the redirected echo). By Unix convention, success is indicated by a return code of 0, all other values are error code with application specific meaning.

Another important issue to consider is that the integer variable, over which iteration is performed should always count down so that the analysis can find a bound. This might require some restructuring of the code, as in the following example, where an explicit counter z is introduced for this purpose. After the loop, the line count and the contents of the last line are printed, using echo. Of course, there is a Linux command that already implements line-count functionality: wc (for word-count) prints, when called with option -l, the number of lines in the file. We use this to check wether our line count is correct, demonstrating numeric operations on the way.

You might be interested in
What is the best platform for a online meeting?
Mice21 [21]

Answer: at the moment i would pick between zoom and something by google

Explanation: Face time is not very useful as only apple users can use other things like house party and the Instagram face chat thing are not good for a professional setting. Skype has been giving me problems with the vast amount of people on it for work.

7 0
3 years ago
Read 2 more answers
Vghfthcnbvhghvngjgjvjgkb, kcnjc cnnfjdhd mc Dan Jfhjc cm. Cm n n hdjfjocnkcnd
seropon [69]

Is this supposed to be a question?

6 0
3 years ago
Read 2 more answers
a 2x4 line decoder with enable is implemented using nand gate only. how many nand gate is needed to construct this line decoder?
arsen [322]

6 NAND gates are needed to construct this line decoder when a 2x4 line decoder with enable is implemented using nand gate only.

What is NAND gate?

The NAND gate is a hybrid of the AND and NOT gates. They are linked in a cascade fashion. It is also known as the Negated And gate. Only when their outputs are high or true does the NAND gate provide a false or low output. The NAND gate is necessary because it is used to implement various types of boolean functions.

The NAND gate has the functional completeness property. The NAND gate's function completeness means that it can be used to implement any type of gate. It functions as an OR, NOR, and AND gate.

To learn more about NAND gate, visit: brainly.com/question/25783048

#SPJ4

8 0
1 year ago
Can you please answer the question in the picture ! :)
Ilya [14]

Answer:

Explanation: If and else statements are one of the most important parts of programming.

1. You add an if you do something if a condition is met. For example, if number of chocolates equals zero( a condition), and inside you can do something like buy more chocolates. And else statement happens if the if condition isn't met and you want to the code to do something else. You don't need this if you don't want anything to happen if the if condition isn't true.

2. This might be used in a number guessing game. Let's say you have to guess a number, if its correct the computer should correct but if you get it wrong it should display wrong. You can write if the number the user writes in equal to the number you are supposed to guess say correct. Else say wrong

Hope this helps. Please mark as brainliest! Thanks!

4 0
3 years ago
Hi, I am from India. Our brainly platform isn't so good, many of 'em keep spamming questions that I ask. US platform seems much
olga_2 [115]
It seems like a great county to visit, with many great views and tourist spots throughout.
7 0
3 years ago
Other questions:
  • Given a computer running four types of instuctions, named classes A through D, calculate the execution time of a program that ha
    5·1 answer
  • Write the method public static doublell quizAverages (double (1 scores). which takes a 2D array of doubles that represent quiz s
    11·1 answer
  • A method that receives a two-dimensional array uses two ____ pairs following the data type in the parameter list of the method h
    11·1 answer
  • How much days are in a year
    9·2 answers
  • How does the binary numbering system differ from the hexadecimal numbering system?
    14·2 answers
  • Ok so this question is kinda weird but does anyone know what google drive is. If so how do you upload a video to it?
    11·2 answers
  • Add me on Fortnite. Epic is smashman892. *Ik it sux but it's an old account* Comment ur epic
    6·2 answers
  • Copying materials from a source text without using is<br> considered plagiarism<br> ?
    5·1 answer
  • Debugging 2.17.3: Debug: The Two Towers Code Hs
    15·1 answer
  • You would like to see only the last 15 lines of /home/user/log file on your linux machine. Which command line interface (cli) co
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!