Ask Question
12 April, 19:14

What stdio. h input function would be used to get input from the user by the keyboard? Write the code to obtain the voltage drop across a resister from the user. Assume the input variable is called vr1. What stdio. h output function would be used to provide output to the monitor?

+4
Answers (1)
  1. 12 April, 20:29
    0
    scanf () function is used to get a input from keyboard. This function is in the stdio. h library. To use this function we must include the stdio. h library first in the code. Then only we can use the scanf () function in any code. printf () function is used to print anything. this function is from stdio. h library.

    Code to read voltage drop across the register.

    #include

    / / main function

    int main (void) {

    / / variable

    double vr1;

    printf ("Enter voltage drop:");

    / / read voltage drop from user

    scanf ("%lf",&vr1);

    / / print voltage drop

    printf ("voltage drop is:%0.2lf", vr1);

    return 0;

    }

    Output:

    Enter voltage drop:200.4

    voltage drop is:200.40
Know the Answer?
Not Sure About the Answer?
Get an answer to your question ✅ “What stdio. h input function would be used to get input from the user by the keyboard? Write the code to obtain the voltage drop across a ...” in 📙 Computers & Technology if there is no answer or all answers are wrong, use a search bar and try to find the answer among similar questions.
Search for Other Answers