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

Padovan string, A Padovan string P(n) for a natural number n is defined as:...

A Padovan string P(n) for a natural number n is defined as: P(0) = ‘X’ P(1) = ‘Y’ P(2) = ‘Z’ P(n) = P(n-2) + P(n-3), n>2 where + denotes string concatenation. For a string of t

Visual basic, a program to accept average, if average is 75 to 85 print it...

a program to accept average, if average is 75 to 85 print it out else bypass using counter. enter and process 5 records

Write a recursive implementation of euclid algorithm, Write a recursive imp...

Write a recursive implementation of Euclid's algorithm for finding the greatest common divisor (GCD) of two integers. Descriptions of this algorithm are available in algebra books

Stack push pop, 2 flowcharts, pseudocode for each (at least 4 algorithms), ...

2 flowcharts, pseudocode for each (at least 4 algorithms), and code for either a stack or a queuestion..

Applied scientific computing in c++, i have a project that is due this Wedn...

i have a project that is due this Wednesday and i was wondering if i can get help in doing it?

C programming a video player, FIT 3042 System Tools and Programming Languag...

FIT 3042 System Tools and Programming Languages Semester 1 2013 Assignment 1 An SDL video player for a custom video format Worth: 20% of final mark. Must be completed individually

Minimization and karnaugh maps, There are formal ways of reducing Boolean e...

There are formal ways of reducing Boolean expressions in order to minimize the logic circuit. The two elementary ways of minimization are using Boolean expressions/De Morgan Theore

Bitcoin alternative – deployment and modification, I started preparing an a...

I started preparing an alternative cryptocurrency and I am way over my head. I would like help in making modifications to the open source files and then help with deployment. I wil

Program to calculate pie, This problem familiarizes you with using random n...

This problem familiarizes you with using random numbers in C++. The program is to compute a good approximation of p using a simulation method called "Monte Carlo". The following fi

Create a album using multi-dimensional arrays, Create a Document that show ...

Create a Document that show information about albums. First create a paragraph or two about the purpose of the page and your interests in music: genres, styles, etc. Next have a

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