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

Write a program of constructors and destructors, Write a program of constru...

Write a program of constructors and destructors Make a class drugs having encapsulated data for medicine name, whether solid or liquid, price and purpose of use. From this clas

Write a c program to input numbes in table format, Write a C program to inp...

Write a C program to input 16 numbers and print them out in a table format of 4 wide by 4 deep. E.g.   4    5    5    7   8    9    10    11   12    13    14    15   16    17

C program for rotation, Normal 0 false false false EN-U...

Normal 0 false false false EN-US X-NONE X-NONE MicrosoftInternetExplorer4

Create a program of several prototypes for functions, In this assignment th...

In this assignment the main has been written for you in the file phone_book_main.cpp. You will also notice that a class called Person has been declared as having several prototypes

C CODING, HOW THE C PROGRAM CODING IMPLEMENTED DY ITSELF UNDERSTANDING . AL...

HOW THE C PROGRAM CODING IMPLEMENTED DY ITSELF UNDERSTANDING . ALSO HOW I CAN A BECOME A GOOD PROGRAMMER IN C WHAT I DO FOR GOOD PROGRAMMING ,TELL ME HOW C CODING DEVELOP DY ITSELF

Psudo code for interrupt handler , The rPeANUt simulator provides buffering...

The rPeANUt simulator provides buffering of the characters that are typed into the terminal. However, this would generally not be the case so if the program did not consume a chara

Illustration of plot function, Illustration of Plot function: To be mo...

Illustration of Plot function: To be more common, the script could prompt the user for the time and temperature, instead of just assigning the values. Then, the axis function

Record of student and calculating marks using ctotal, reocord of a student ...

reocord of a student and a function ctotal to calculate the marks of any three subject by using ctotal() function

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