write a program to determine vc for a given value


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);  
 
}

Request for Solution File

Ask an Expert for Answer!!
C/C++ Programming: write a program to determine vc for a given value
Reference No:- TGS0414853

Expected delivery within 24 Hours