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

Explain briefly about class and objects, Question 1. Explain Briefly ab...

Question 1. Explain Briefly about class and objects. 2. Create a class string which stores a string value. Overload ++ operator which converts the characters of the string t

Pebble merchant, there is a pebble merchant. he sells the pebbles,that are ...

there is a pebble merchant. he sells the pebbles,that are used for shining the floor.his main duty is to take the length of the room side but he sometines mistakes doing that and m

Is there present a way to force new to allocate memory, Yes. "Memory pools"...

Yes. "Memory pools" are useful in many situations. The bad news is that I'll need to drag you through the mire of how it acts before we talk about all the uses. Firstly, recall

Define commonly used built-in library functions, Define Commonly Used Built...

Define Commonly Used Built-in Library Functions? Comprise opened a file pointer you will desire to use it for either input or output. The C language supplies a set of functions

Program of three numbers arguments and returns the sum , Define a procedure...

Define a procedure that takes three numbers as arguments and returns the sum of the squares of the two larger numbers.

Project, Project Overview A certain financial institution (bank) wishes to ...

Project Overview A certain financial institution (bank) wishes to promote its new business products/services by conducting road shows in rural areas. Their aim is to encourage peop

Theory, recursive sub programs

recursive sub programs

Programming, pseudocode for gregorian calendar

pseudocode for gregorian calendar

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