Functions

#include <stdio.h>
#include <math.h>
#include <conio.h>

void main(void)
{float x,w;const float a=2;
clrscr();
printf("Culege valoarea lui x:\n");
scanf("%f",&x);
if(x>a)w=x*(pow(x-a)/1/3);
else if(x==a)w=x*(sin(a*x));
else w=exp(-a*x)*cos(a*x);
printf("x=%f,w=%f",x,w);
getch();
}



What did I made wrong in this program?
I can't fix one error
1. main returns int
2. pow() takes two arguments
3. clrscr() and getch() are not standard

http://www.cplusplus.com/reference/clibrary/cmath/pow/
Should i replace pow with sqrt?...I have radical of 3 degree....I don't speak very well english
so appologize for mistakes
Topic archived. No new replies allowed.