1-3-10: Calculate the resistance of the shunt resistor

Source: Internet
Author: User

Describe

For resistors with resistance of R1 and R2, the parallel resistor resistance formula is calculated as follows:

R = 1/(1/R1 + 1/r2)

Input two resistor impedance size, floating point, separated by a space. The impedance after the output is in parallel, the result is 2-bit sample input after the decimal point is retained

1 2

Sample output

0.67

Hint that the calculation process uses the float type

1#include <stdio.h>2#include <math.h>3 intMain ()4 {5     floatr,r1,r2;6scanf"%f%f",&r1,&r2);7R=1/(1/r1+1/r2);8printf"%.2f\n", R);9     return 0;Ten}

1-3-10: Calculate the resistance of the shunt resistor

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.