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]
3 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]3 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 do work places allow a company to do
anygoal [31]
D. They provide a platform for collaboration
8 0
3 years ago
HELLLP
mojhsa [17]

Explanation:

The output of this program is 5 7, because the first time bruce is printed, his value is 5, and the second time, his value is 7. The comma at the end of the first print statement suppresses the newline after the output, which is why both outputs appear on the same line.

Here is what multiple assignment looks like in a state diagram:



With multiple assignment it is especially important to distinguish between an assignment operation and a statement of equality. Because Python uses the equal sign (=) for assignment, it is tempting to interpret a statement like a = b as a statement of equality. It is not!

First, equality is symmetric and assignment is not. For example, in mathematics, if a = 7 then 7 = a. But in Python, the statement a = 7 is legal and 7 = a is not.

Furthermore, in mathematics, a statement of equality is always true. If a = b now, then a will always equal b. In Python, an assignment statement can make two variables equal, but they don’t have to stay that way:

a = 5

4 0
3 years ago
Read 2 more answers
Can i have two e-mail accounts on my android
Scrat [10]
Yes, if you download an app such as gmail or yahoo mail. hope this answered your question.
5 0
3 years ago
ANSWER ASAP, I'LL MARK THE BRAINLIEST
Travka [436]

Answer:

Push to make switch

Explanation:

The sound is created after you push it. Pushing it is the input and the sound is the output

4 0
3 years ago
I have a lot of stuff on my pc and I want to make my pc brand new from when I bought it, How do I clean my pc to make it where i
stepan [7]
Well if your talking about physically you could get some compressed air and blow it out. Or if your talking about performance you could try to re-install the os you have on it or replace the hdd with a ssd or higher performance hard disk for it to run like new. :)
5 0
3 years ago
Read 2 more answers
Other questions:
  • Henry uploaded the photos of his birthday to a cloud storage system. He feels that it’s a safe option for data storage. His frie
    12·1 answer
  • How should a cover letter begin?
    13·2 answers
  • I need help making a survey for highschool students in my school any topics/questions?
    9·1 answer
  • Which topology enables only one person, at one time, to send data to others on the network?
    6·1 answer
  • Green field county stadium is planning to conduct a circket match between two teams A and B. A large crowd is expected in the st
    13·1 answer
  • why does it not let me create a new account when i log out of this one and go to join now after i fill everything out it wont le
    11·1 answer
  • Who all likes fortnite
    15·2 answers
  • Which of the following prefixes would be best to use when measuring your own mass?
    15·1 answer
  • Refer to the image on the right. Then, using the drop-down menu, identify the correct printer type. A: inexpensive home printer
    10·1 answer
  • outline 4 IDE features that makes software development much faster and more convenient than other alternatives.​
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!