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
umka21 [38]
3 years ago
11

Write a function call with arguments tensPlace, onesPlace, and userInt. Be sure to pass the first two arguments as pointers. Sam

ple output for the given program: tensPlace = 4, onesPlace = 1
Engineering
1 answer:
Trava [24]3 years ago
4 0

Answer:

#include <stdio.h>

void SplitIntoTensOnes(int* tensDigit, int* onesDigit, int DecVal){

  *tensDigit = (DecVal / 10) % 10;

  *onesDigit = DecVal % 10;

  return;

}

int main(void) {

  int tensPlace = 0;

  int onesPlace = 0;

  int userInt = 0;

  userInt = 41;

  SplitIntoTensOnes(&tensPlace, &onesPlace, userInt);

  printf("tensPlace = %d, onesPlace = %d\n", tensPlace, onesPlace);

  return 0;

}

You might be interested in
Intravenous infusions are usually driven by gravity by hanging the bottle at a sufficient height to counteract the blood pressur
Bingel [31]

Answer:

(a) BP = 11.99 KPa

(b) h = 2 m

Explanation:

(a)

Since, the fluid pressure and blood pressure balance each other. Therefore:

BP = ρgh

where,

BP = Blood Pressure

ρ = density of fluid = 1020 kg/m³

g = acceleration due to gravity = 9.8 m/s²

h = height of fluid = 1.2 m

Therefore,

BP = (1020 kg/m³)(9.8 m/s²)(1.2 m)

<u>BP = 11995.2 Pa = 11.99 KPa</u>

(b)

Again using the equation:

P = ρgh

with data:

P = Gauge Pressure = 20 KPa = 20000 Pa

ρ = density of fluid = 1020 kg/m³

g = acceleration due to gravity = 9.8 m/s²

h = height of fluid = ?

Therefore,

20000 Pa = (1020 kg/m³)(9.8 m/s²)h

<u>h = 2 m</u>

7 0
3 years ago
If a vacuum gau ge reads 9.62 psi, it means that: a. the very highest column of mercury it could support would be 19.58 inches.
scZoUnD [109]

Answer:All of the above

Explanation:

9.62 psi means 497.49 mm of Hg pressure

for (a)19.58 inches is equals to 497.49 mm of Hg

(b)atmospheric pressure is 14.69 psi

vaccum gauge is 9.62psi

absolute pressure is=14.69-9.62=5.07

(c)vaccum means air is sucked and there is negative pressure so it tells about below atmospheric pressure.

thus all are correct

8 0
3 years ago
CS3733: Homework/Practice 05 Suppose we would like to write a program called monitor which allows two other programs to communic
valina [46]

Answer:

#include<stdio.h>

#include<stdlib.h>

#include<unistd.h>

#include<sys/types.h>

#include<string.h>

#include<pthread.h>

//#include<sys/wait.h>

int main(int argc, char** argv)

{

int fd1[2];

int fd2[2];

int fd3[2];

int fd4[2];

char message[] = "abcd";

char input_str[100];

pid_t p,q;

if (pipe(fd1)==-1)

{

 fprintf(stderr, "Pipe Failed" );

 return 1;

}

if (pipe(fd2)==-1)

{

 fprintf(stderr, "Pipe Failed" );

 return 1;

}

if (pipe(fd3)==-1)

{

 fprintf(stderr, "Pipe Failed" );

 return 1;

}

if (pipe(fd4)==-1)

{

 fprintf(stderr, "Pipe Failed" );

 return 1;

}

p = fork();

if (p < 0)

{

 fprintf(stderr, "fork Failed" );

return 1;

}

// child process-1

else if (p == 0)

{

 close(fd1[0]);// Close reading end of first pipe

 char concat_str[100];

 printf("\n\tEnter meaaage:"):

 scanf("%s",concat_str);

 write(fd1[1], concat_str, strlen(concat_str)+1);

 // Concatenate a fixed string with it

 int k = strlen(concat_str);

 int i;

 for (i=0; i<strlen(fixed_str); i++)

 {

  concat_str[k++] = fixed_str[i];

 }

 concat_str[k] = '\0';//string ends with '\0'

 // Close both writting ends

 close(fd1[1]);

 wait(NULL);

//.......................................................................

 close(fd2[1]);

 read(fd2[0], concat_str, 100);

 if(strcmp(concat_str,"invalid")==0)

 {

 printf("\n\tmessage not send");

 }

 else

 {

  printf("\n\tmessage send to prog_2(child_2).");

 }

 close(fd2[0]);//close reading end of pipe 2

 exit(0);

}

else

{

 close(fd1[1]);//Close writting end of first pipe

 char concat_str[100];

 read(fd1[0], concal_str, strlen(concat_str)+1);

 close(fd1[0]);

 close(fd2[0]);//Close writing end of second pipe

 if(/*check if msg is valid or not*/)

 {

  //if not then

  write(fd2[1], "invalid",sizeof(concat_str));

  return 0;

 }

 else

 {

  //if yes then

  write(fd2[1], "valid",sizeof(concat_str));

  close(fd2[1]);

  q=fork();//create chile process 2

  if(q>0)

  {

   close(fd3[0]);/*close read head offd3[] */

   write(fd3[1],concat_str,sizeof(concat_str);//write message by monitor(main process) using fd3[1]

   close(fd3[1]);

   wait(NULL);//wait till child_process_2 send ACK

   //...........................................................

   close(fd4[1]);

   read(fd4[0],concat_str,100);

   close(fd4[0]);

   if(sctcmp(concat_str,"ack")==0)

   {

    printf("Messageof child process_1 is received by child process_2");

   }

   else

   {

    printf("Messageof child process_1 is not received by child process_2");

   }

  }

  else

  {

   if(p<0)

   {

    printf("Chiile_Procrss_2 not cheated");

   }

   else

   {

     

    close(fd3[1]);//Close writing end of first pipe

    char concat_str[100];

    read(fd3[0], concal_str, strlen(concat_str)+1);

    close(fd3[0]);

    close(fd4[0]);//Close writing end of second pipe

    write(fd4[1], "ack",sizeof(concat_str));

     

   }

  }

 }

 close(fd2[1]);

}

}

8 0
3 years ago
Repetitive movements at work can lead to injuries. True or False
OverLord2011 [107]
Answer

True

Explanation

RSI can occur when you do repetitive movements. Those movements can cause your muscles and tendons to become damaged over time. Some activities that can increase your risk for RSI are: stressing the same muscles through repetition.
8 0
2 years ago
Calculate the rate at which body heat is conducted through the clothing of a skier in a steady- state process, given the followi
olga2289 [7]

Answer:

230.4W

Explanation:

Heat transfer by conduction consists of the transport of energy in the form of heat through solids, in this case a jacket.

the equation is as follows

Q=\frac{KA(T2-T1)}{L} \\

Where

Q=heat

k=conductivity=0.04

A=Area=1.8m^2

T2=33C

T1=1C

L=thickness=1cm=0.01mQ=\frac{(0.04)(1.8m^2)(33-1)}{0.01m}

Q=230.4W

the skier loses heat at the rate of 230.4W

4 0
3 years ago
Other questions:
  • To water his lawn, a homeowner uses two hoses. One connects to the faucet, the other to the end of the first hose to make the ho
    14·1 answer
  • Calculate the impedance of a 20 mH inductor at a frequency of 100 radians/s. Calculate the impedance of a 500 µF inductor at a f
    9·2 answers
  • This problem demonstrates aliasing. Generate a 512-point waveform consisting of 2 sinusoids at 200 and 400-Hz. Assume a sampling
    8·1 answer
  • Saturated liquid water at 150 F is put under pressure to decrease the volume by 1% while keeping the temperature constant. To wh
    8·1 answer
  • (a) Sabbir usually (sit)______ in the front bench.
    13·1 answer
  • The heat transfer surface area of a fin is equal to the sum of all surfaces of the fin exposed to the surrounding medium, includ
    6·1 answer
  • For somebody
    12·1 answer
  • ⊂who else is obsessed with the ornail
    9·1 answer
  • ───────────────────────────────
    7·1 answer
  • Two solid yellow center lines on a two-lane highway indicate:
    13·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!