Calculate the discharge by c program, C/C++ Programming

Assignment Help:

#include stdio.h
#include math.h

float discharge(float,float);
void main()
  {
  char prompt;   
  float time,out,cr;
  cr = 100e-6;
  for (time = 0;time<=5*cr;time+=10e-6)
  {
  /* call the function */
  out = discharge(time,cr);
  /*Note g formattor defaults to expontential */
printf("The capacitor voltage at time %10.5g seconds  is %5.3f \n\r ",time,out);
  }    
  printf("Press any key to exit \n\r");
  scanf("\n%c",&prompt);  
  }
 
float discharge(float t,float cr)
{
  float vs,vc;
  /* calculate the discharge */
  vs = 10.0;
  vc = vs*exp(-t/cr);
  return(vc);
}


Related Discussions:- Calculate the discharge by c program

Linux driver and linux, Project Description: I´ve a need linux programmi...

Project Description: I´ve a need linux programming job. if you are interested, Skills required are C Programming, PCB Layout, Embedded Software, Python, Software Architecture

What is a conversion constructor c++, A constructor that accepts one argume...

A constructor that accepts one argument of a dissimilar type.

Determine the size of operator, The size of () operator This is a pseud...

The size of () operator This is a pseudo-operator given by the language, which returns the number of bytes taken up by a variable or data type. The value returned by this opera

Computer programing, pls give me answer 01110-00110 in 2''s comlpiment in d...

pls give me answer 01110-00110 in 2''s comlpiment in detail

Circle queue, countSpaceAvailbility function that counts and returns the sp...

countSpaceAvailbility function that counts and returns the space availability in the circle queue there are two elemnts at the circle queue and should return 5 space if size 7 .

Cin, how we use the cin command and why we use this command????

how we use the cin command and why we use this command????

Pointers, one of the applications of computers in numerical analysis is com...

one of the applications of computers in numerical analysis is computing the area under a curve. one method of calculating the area under acurve is to divide the area int a number o

#c++, There is a pebble merchant. He sells the pebbles, that are used for s...

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’s sides. But he sometimes mistakes doing that

Luminous jewels polishing necklace, 1.jewels can only be removed for polish...

1.jewels can only be removed for polishing from either end of the necklace. 2.cost of polishing=sitting number*colour value of jewels.

Read writers problem, Readers Writers with Processes and Threads Write two ...

Readers Writers with Processes and Threads Write two programs implementing ``reader pritority readers-writers synchronization'''' on files. One program will use processes, created

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