Program problem??

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#include <iostream>
#include <iomanip>
#include <cmath>
using namespace std;

int y,r,s,C,n;
int main() {

double d=1/(1+y/2);
	cout << setprecision(8);
	double dirtyprice=pow(d,r/s)*(C/2*(1-pow(d,n+1))/(1-d)+100*pow(d,n));
	double accruedinterest=C/2*((s-r)/s);

	return 0;
}


when i try to run this code, there is no output, no errors or warnings.

it just says

"Unhandled exception at 0x00171435 in fo08ttr_a2.exe: 0xC0000094: Integer division by zero." Break or Continue.

I cant see what the problem is.

Seriously? So you expect that program to divide by y, r, s, C, & n, when the variables have not been assigned any value? They'll just be treated as zero.
smh of course!
thanks
Topic archived. No new replies allowed.