Determine the capacitor voltage by c program, C/C++ Programming

Assignment Help:

Write a program to determine Vc for a given value of time (t)
 
#include stdio.h
#include math.h
void main()

 
  char prompt;

  float vs,cr,t,vc;
  /* input time */
  printf("Please enter in the time \n\r");
  scanf("%f",&t);\
  /* calculate the discharge */
  cr = 100e-6;
  vs = 10.0;
  vc = vs*exp(-t/cr);
  /*Note g formattor defaults to expontential */
  printf("The capacitor voltage at time %g seconds is %5.3f",t,vc);  
  printf("Press any key to exit \n\r");
  scanf("\n%c",&prompt);  
 
}


Related Discussions:- Determine the capacitor voltage by c program

What do you mean by inheritance, Inheritance is the process of forming new ...

Inheritance is the process of forming new classes, called derived classes, from existing classes or base classes. The derived class inherits all the capabilities of the base class,

Algorithm, Write an algorithm to print all even numbers in descending order...

Write an algorithm to print all even numbers in descending order and draw the flowchart.

C program for function of average, C program for function  of average ...

C program for function  of average int average(int); void main() {           int max=0,c=0;           clrscr();           printf("ENTER THE LIMIT OF INPUT FOR AV

Destructor on a local variable, Should I explicitly call a destructor on a ...

Should I explicitly call a destructor on a local variable? Explain it.

Described the isa and hasa class relationships. , Described the ISA and HAS...

Described the ISA and HASA class relationships. How would you apply each in a class design? A: A specialized class "is" specialization of another class and, thus, has the ISA re

Single string programme, write a programme that allows a user to enter 5 di...

write a programme that allows a user to enter 5 distinct words and returns them as a single string

Operator overloading - c++ program, Operator overloading - c++ program: ...

Operator overloading - c++ program: Write a program in c to define operator overloading. class matrix{                   private :                 int x[2][2];

Decode the code, Smugglers are becoming very smart day by day. Now they hav...

Smugglers are becoming very smart day by day. Now they have developed a new technique of sending their messages from one smuggler to another. In their new technology, they are send

Should i employ null or 0?, A: In C++, the definition of NULL is 0, thus th...

A: In C++, the definition of NULL is 0, thus there is only an aesthetic difference. I prefer to ignore macros, so I employ 0. Another difficulty with NULL is that people sometimes

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd