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

What is the output of the following program fragment. Choose appropriate data-types of variables to match output.

Engineering
1 answer:
Alexxx [7]3 years ago
3 0

Answer:

1

Explanation:

Given :

i=7;j=8;k=9;

printf(“%d”,(i+10)%k/j);

The printf function only displays the result

%d - is used for the display format

However, the actual calculation is in the expression: (i+10)%k/j

Given the variables :

i = 7 ;

j = 8 ;

k = 9 ;

(i + 10) = (7 + 10) = 17

(i + 10) % k = 17 % 9

% = remainder value after division

17 % 9 = (17 / 9) = 1 remainder 8

17 % 9 = 8

Hence,

(i + 10) % k = 8

(i + 10) % k / j

j = 8

8 / 8

= 1

You might be interested in
3 examples of technology transfer pls
OLEGan [10]

Answer: electrical, mathematical, and geographical

Explanation: Yee  

                              - Cash Nasty

3 0
3 years ago
Read 2 more answers
A 36 ft simply supported beam is loaded with concentrated loads 16 ft inwards from each support. On the left side, the dead load
lana66690 [7]

Answer:

1st part: Section W18X76  is adequate

2nd part: Section W21X62 is adequate

Explanation:

See the attached file for the calculation

8 0
3 years ago
(TCO 4) A system samples a sinusoid of frequency 190 Hz at a rate of 120 Hz and writes the sampled signal to its output without
steposvetlana [31]

Answer:

The frequency that the sampling system will generate in its output is 70 Hz

Explanation:

Given;

F = 190 Hz

Fs = 120 Hz

Output Frequency = F - nFs

When n = 1

Output Frequency = 190 - 120 = 70 Hz

Therefore, if a system samples a sinusoid of frequency 190 Hz at a rate of 120 Hz and writes the sampled signal to its output without further modification, the frequency that the sampling system will generate in its output is 70 Hz

5 0
3 years ago
C++ - Green Crud Fibonacci programThe following program is to be written with a loop. You are to write this program three times
Fynjy0 [20]

Answer:

Below is the required code:

Explanation:

Using for loop

#include <iostream>

using namespace std;

int main()

{

    //Initial crud size

    int init = 0;

    int newCrud;

    int next=0;

    //Number of days to simulate

    int no_days;

    int day;

    cout << "Enter initial amount of green crud: ";

    cin >> newCrud;

    cout << "Enter number of days to simulate: ";

    cin >> no_days;

    for (day = 10; day<=no_days; day++)

    {

         if (day % 10 == 0)

         {

             next = newCrud + init;

         }

             newCrud = init;

             init = next;

    }

    if (no_days < 5)

    cout << "\nCrud reproduce only after 5 days minimum.Hence the current amount is "

    << newCrud << " pounds.";

    else

    cout << "On day " << no_days << " you have " << init

    << " pounds of green crud." << endl;

    cout << "\nWould you like to continue? (y or n): ";

    cin >> ans;

         return 0;

}

Output:

         Enter initial amount of green crud: 5

         Enter number of days to simulate: 220

    On day 220 you have 10485760 pounds of green crud.

Using while loop

Program:

#include <iostream>

using namespace std;

int main()

{

    char ans='y';

    while (ans == 'Y' || ans == 'y')

    {

         //Initial crud size

         int init = 0;

         int newCrud;

         int next=0;

         //Number of days to simulate

         int no_days;

         int day;

         cout << "Enter initial amount of green crud:

         ";

         cin >> newCrud;

         cout << "Enter number of days to simulate:

         ";

         cin >> no_days;

         for (day = 10; day<=no_days; day++)

         {

             if (day % 10 == 0)

             {

                  next = newCrud + init;

             }

                  newCrud = init;

                  init = next;

         }

         if (no_days < 5)

         cout << "\nCrud reproduce only after 5 days

         minimum.Hence the current amount is "

         << newCrud << " pounds.";

         else

         cout << "On day " << no_days << " you have "

         << init

         << " pounds of green crud." << endl;

         cout << "\nWould you like to continue? (y or

         n): ";

         cin >> ans;

    }

    return 0;

}

Output:

Enter initial amount of green crud: 5

Enter number of days to simulate: 220

On day 220 you have 10485760 pounds of green crud.

Would you like to continue? (y or n): y

Enter initial amount of green crud: 5

Enter number of days to simulate: 225

On day 225 you have 10485760 pounds of green crud.

Using do while loop

Program:

#include <iostream>

using namespace std;

int main()

{

    char ans;

    do

    {

         //Initial crud size

         int init = 0;

         int newCrud;

         int next=0;

         //Number of days to simulate

         int no_days;

         int day;

         cout << "Enter initial amount of green crud: ";

         cin >> newCrud;

         cout << "Enter number of days to simulate: ";

         cin >> no_days;

         for (day = 10; day<=no_days; day++)

         {

             if (day % 10 == 0)

             {

                  next = newCrud + init;

             }

                  newCrud = init;

                  init = next;

         }

         if (no_days < 5)

         cout << "\nCrud reproduce only after 5 days

         minimum.Hence the current amount is "

         << newCrud << " pounds.";

         else

         

         cout << "On day " << no_days << " you have " <<

         init << " pounds of green crud." << endl;

         cout << "\nWould you like to continue? (y or n):

         ";

         cin >> ans;

    } while (ans == 'Y' || ans == 'y');

    return 0;

}

Output:

Enter initial amount of green crud: 5

Enter number of days to simulate: 220

On day 220 you have 10485760 pounds of green crud.

Would you like to continue? (y or n): y

Enter initial amount of green crud: 5

Enter number of days to simulate: 225

On day 225 you have 10485760 pounds of green crud.

7 0
3 years ago
Consider a refrigerator that consumes 320 W of electric power when it is running. If the refrigerator runs only one quarterof th
ryzh [129]

Answer:

$5.184

Explanation:

The cost can be calculated using the formula: Cost = Load \ factor \times Number \ of \ hours \ \\M_{month} = M_{units} \times W\\

Before using this, we require the following conversions:

<em>320 W → kW:</em>

\frac {320}{1000} = 0.32

<em>30 Days → Hours:</em>

30 \times 24 = 720

Using the above stated formula:

M_{month} = 0.09 \times 0.32 \times \frac{1}{4} \times 720 = 5.184

4 0
3 years ago
Other questions:
  • Refectories are one of the types of ceramics that have low melting temperature. a)-True b)-False
    7·1 answer
  • Write down the equation for the stoichiometric combustion of propane (C3H8).
    6·1 answer
  • Torque is a twisting force. If the required torque applied on a 3 ft wrench is 45 ft·lb, what is the force that must be applied?
    5·1 answer
  • Hii I need help can someone help me
    15·1 answer
  • We need to design a logic circuit for interchanging two logic signals. The system has three inputs I1I1, I2I2, and SS as well as
    11·1 answer
  • Q1. Basic calculation of the First law (2’) (a) Suppose that 150 kJ of work are used to compress a spring, and that 25 kJ of hea
    6·1 answer
  • Certain pieces made by an acoustic lathe are subject to three kinds of defects X,Y,Z. A sample of 100 pieces was inspected with
    6·1 answer
  • An atom that gained an electron is called​
    10·2 answers
  • Pleaseeee help me with this!!
    10·1 answer
  • which acpi power state allows a system to start where it left off, but all other components are turned off? sleeping mechanical
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!