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
Vinil7 [7]
3 years ago
10

#include #include int main( ) { int value = 10; int pid; value += 5; pid = fork( ); if (pid > 0 ) { value += 20; } printf(val

ue); return 0; } Select all the values that may be printed on the screen when the above program is executed?
Computers and Technology
1 answer:
ss7ja [257]3 years ago
8 0

Explanation:

To understand how this program is working let us print the variable value at different stages of the program so that we can understand how it is working.

Intitally, value=10 when it was declared.

Then we added 5 and it become value=15

then we used fork() function which creates a parent(orignal) and child(duplicate)

When fork() succeeds it returns the child pid to parent and returns 0 to the child. As you can see (pid > 0) condition is always true therefore the parent pid value becomes 35 ( 15+20) and the child pid value becomes 0.

#include <stdio.h>

#include <unistd.h>

int main( ) {

   int value = 10;

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

   int pid;

   value += 5;

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

   pid = fork( );

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

   if (pid > 0 )

   {

       value += 20;

   }

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

   return 0;

}

Output:

10 (initial value)

15 (modified value)

5343 (pid when fork is used)

35 (final modified value)

0 (child value)

15 (the parent value when fork was used)

You might be interested in
a user has a large amount of data that she or he needs to store. the data will not be accessed regularly, but still needs to be
Flura [38]
You need a sd card so you can store it and use it later
6 0
2 years ago
Read 2 more answers
A(n) ______ is a type of collaborative website that allows users to create, add, modify, or delete website content.
andrey2020 [161]
<span>A wiki is this type of site. The users can, anonymously or with a profile, add to or delete content already posted. This gives the community the ability to add to the overall knowledge base on a specific subject. The site tracks changes through IP addresses to make sure that changes are not done maliciously.</span>
8 0
3 years ago
: Describe the type of gameplay seen during early video games (ex. Spacewar!, Pong).
Alexeev081 [22]

Answer:

Computer scientists began building rudimentary games and simulations on mainframe computers in the 1950s and 1960s, with MIT's Spacewar! in 1962 being one of the first such games to be played with a video display. The first consumer-ready video game hardware arrived in the early 1970s, with the Magnavox Odyssey, the first home video game system, and the first arcade video games from Atari, Computer Space and Pong, the latter of which was later transformed into a home console version. Pong's success in arcades and at home prompted numerous firms to create clones of the game, resulting in a market contraction in 1978 owing to oversaturation and a lack of innovation.

8 0
2 years ago
In 1940, the FCC reserved a set of frequencies in the lower range of the FM radio spectrum for _____ purposes as part of its reg
Monica [59]

Answer:

education purposes

Explanation:

Education institutes make some programs like School of the Air and College of the Air, forums, and discussion tables, in 1940 the FCC reserved a range of the FM radio spectrum for education purposes.

Although FM was unpopular when the FCC moved the FM bandwidth to a higher set of frequencies, and people and consumer stations had to buy new equipment.

5 0
3 years ago
After reviewing device security you learn that a malicious user in an airport
NARA [144]

Answer:

Sniffing.

Explanation:

Data theft can be defined as a cyber attack which typically involves an unauthorized access to a user's data with the sole intention to use for fraudulent purposes or illegal operations. There are several methods used by cyber criminals or hackers to obtain user data and these includes DDOS attack, SQL injection, man in the middle, phishing, sniffing, etc.

Sniffing can be defined as a form of cyber attack in which a malicious user gains access to a private network with the intent of finding out what information is stored on the network.

A packet sniffer also known as a packet analyzer, is a computer software or hardware tool that can be used to intercept, log and analyze network traffic and data that passes through a digital network.

Basically, an unauthorized packet sniffer is used to steal user informations.

This ultimately implies that, sniffing typically involves monitoring and capturing internet traffic (data packets) that are transmitted through a private network in real-time by using a sniffing tool, which may either be a hardware or software.

In this scenario, a malicious user in an airport terminal seating area was able to connect wirelessly to a traveling employee's smartphone and downloaded her contact list. Thus, the type of attack that has taken place is referred to as sniffing.

4 0
3 years ago
Other questions:
  • Is anyone else experiencing the wording::nonifacation::glitch about the "5 hours ago" thingy to whenever you answer a question o
    7·2 answers
  • How would you print from 1 to 1000
    13·1 answer
  • An application is to be written that would allow students to find out their GPA(double) and their total number of credits (an in
    15·1 answer
  • What needs to be increased in order to increase image size and clarity?
    10·1 answer
  • . Select the advantages of RAID-5 relative to other RAID schemes. (MAY SELECT MULTIPLE)
    7·1 answer
  • In general, smartphones do NOT hold as much personal information as tablets.
    11·1 answer
  • What is the family access code right now?
    5·1 answer
  • If you wanted to create a line of code that would add ten to the user’s current score, which code should you use?
    12·2 answers
  • True or False? Popular sites are always mean accurate.
    14·2 answers
  • What represents a user’s specific preferences?
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!