[ create a new paste ] login | about

Link: http://codepad.org/QBcd0CQN    [ raw code | output | fork ]

Rituparnadatta - C, pasted on Aug 19:
//series resistance //
#include<stdio.h>
int main()
{
float resistance1,resistance2,resistance3,resistance4, voltage, current,totalresistance;

//input

resistance1=47.0;
resistance2=100;
resistance3=270;
voltage=420.0;

printf("the voltage:%5f V\n",voltage);

//processing

totalresistance=resistance1+resistance2+resistance3;

printf("the total resistance:%5f ohm\n",totalresistance);

current=voltage/totalresistance;

printf("the current is: %f A \n",current);

return 0;
}
//unit calculate your self


Output:
1
2
3
the voltage:420.000000 V
the total resistance:417.000000 ohm
the current is: 1.007194 A 


Create a new paste based on this one


Comments: