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
ololo11 [35]
3 years ago
9

Assume that name and age have been declared suitably for storing names (like "abdullah", "alexandra" and "zoe") and ages respect

ively. assume also that stdin is a variable that references a scanner object associated with standard input. write some code that reads in a name and an age and then prints the message "the age of name is age" on a line by itself, where name and age are replaced by the values read in for the variables name and age. for example, if your code read in "rohit" and 70 then it would print out "the age of rohit is 70" on a line by itself. there should not be a period in the output.
Computers and Technology
1 answer:
Troyanec [42]3 years ago
7 0
Name = "Bob"
age = 50

print("The age of" , name , "is" , age)
You might be interested in
Which of these statements regarding mobile games is true? A. They are typically played indoors. B. They have detailed environmen
Lyrx [107]

Answer:

c and d

Explanation:

6 0
4 years ago
Can some please help me learn how to make a program via Binary Code?
padilas [110]
Look up binary code dictionary it will help you learn codes in letter of binary
8 0
4 years ago
Using the program below, explain what the output will be at LINE A. 1 #include 2#include 3#include 4 5 int value - 128; 6 7 int
slega [8]

Answer:

This is the complete correct program:

#include <stdio.h>

#include<sys/types.h>

#include<unistd.h>

int value = 128;

int main()

{

  pid_t pid;

  pid=fork();

  if (pid==0) /* child process */

  {

  value +=8;

  return 0; }

  else if (pid > 0) {/* parent process */

 wait (NULL);

 printf ("PARENT: value =%d\n" ,value); /* LINEA */

 return 0;

}

}

The output of the LINE A is:

PARENT: value = 128

Explanation:

The fork() function used in the program creates a new process and this process is the child process. The child process is same as the original process having its own address space or memory.

In the child process the value of pid is 0. So the if condition checks if pid==0. Then the child process adds 8 to the value of its variable according to the following statement  

value +=8;

Now the original process has value = 128. In else if part the parents process has the value of pid greater than zero and this portion of the program is of the parent process :

else if (pid > 0)

{ wait (NULL);

printf ("PARENT: value =%d\n" ,value);

return 0; }

So the value 128 is printed at the end in the output.

wait(NULL) is used to wait for the child process to terminate so the parent process waits untill child process completes.

So the conclusion is that even if the value of the variable pid is changed in the child process but it will not affect the value in the variable of the parent process.

5 0
3 years ago
Document templates are available online.<br> True<br> False
k0ka [10]
True anything is available online.
6 0
3 years ago
Read 2 more answers
On mad max ps4, why does the v6 sound beter and healthier than the v8
nadya68 [22]
Um is that a question?

5 0
3 years ago
Other questions:
  • Mention five features of word processing application​
    10·1 answer
  • Write a program that asks the user to enter two dates (in YYYY-MM-DD format), and then prints which date is earlier. Your progra
    15·1 answer
  • What is the name for a partition that has been formatted and assigned a drive letter?
    8·1 answer
  • Which type of computer operating system would be best for a large corporation?
    7·2 answers
  • Which of these ia an example of gene flow?
    5·1 answer
  • When a collection of honeypots connects several honeypot systems on a subnet, it may be called a(n) honeynet
    9·1 answer
  • Every Java statement ends with: *<br><br> Period<br> Colon<br> Double quote<br> Semicolon
    11·2 answers
  • Magnetic video tape in a plastic casing is a?
    13·1 answer
  • what field in the ipv4 datagram header can be used to ensure that a packet is forwarded through no more than N headers
    8·1 answer
  • What are backup storage devices of computer? Why are they necessary in the computer system?​
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!