shows a mistake! urgent help needed!

Guys, I would much appreciate if you help me with my issue.
I write the program, it shows no error, but when I compile and run it shows:"program stopped working"
what should I do?
#include <stdio.h>
#include<stdlib.h>
#include <math.h>
#include <iostream>
#include <iomanip>
#include <complex>
#define PI 3.1415926



int main ()
{
float q,P,kave, ky,kx,deltaX, deltaY, h, Psc, M, Bo, Rw, S,Re, x;
int i;
printf("Decide what program should calculate please: q or P \n");
printf(" For flow rate enter 1 please \n");
scanf("%d",i);

if (i==1) {
printf("Enter value for ky: \n");
scanf("%f", &ky);
printf("Enter value for kx: \n");
scanf("%f", &kx);
kave=sqrt(kx*kx+ky*ky);
printf("kave is %f\n",kave);
printf("Enter value for deltaX: \n");
scanf("%f", &deltaX);
printf("Enter value for deltaY: \n");
scanf("%f", &deltaY);
Re=0.28*sqrt((pow(float(kx/ky),(1/2))*((deltaX)*(deltaX))+pow(float(ky/kx),(1/2))*((deltaY)*(deltaY))/(pow(float(ky/kx),(1/4))+pow(float(kx/ky),(1/4)))));
printf("Re is %f\n",Re);
printf("Enter value for h: \n");
scanf("%f", &h);
printf("Enter value for P:\n");
scanf("%f", &P);
printf("Enter value for Psc: \n");
scanf("%f", &Psc);
printf("Enter value for M: \n");
scanf("%f", &M);
printf("Enter value for Bo:\n");
scanf("%f", &Bo);
printf("Enter value for Rw: \n");
scanf("%f", &Rw);
printf("Enter value for S:\n");
scanf("%f", &S);

q=(2*PI*kave*h*(P-Psc))/(M*Bo*(log(Re/Rw)+S));
printf("q is %f\n",q);
}


system ("pause");
return 0;
}
This:
scanf("%d",i);
is wrong. You need to pass the address of i, not i.

After making that change the program runs for me but I don't know if it's producing the output that you want.
Topic archived. No new replies allowed.