Ask Question
8 August, 17:06

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?

+2
Answers (1)
  1. 8 August, 17:21
    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?
Find 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 and Technology if you're in doubt about the correctness of the answers or there's no answer, then try to use the smart search and find answers to the similar questions.
Search for Other Answers