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