התרגיל:

ה-VS עושה לי שגיאה, מישהו יכול לתקן אותי?
תודה רבה.
#include <stdio.h> #include <math.h> int power(int,int);int power( int up, int down)/* חישוב חזקה */ { int pow=0; while(up>0) { pow+=down; up--; } return pow; } void main () /* פונקציה E^x */ { int n, x, start, azeret=0, pow=0, hezka=0; double result=0; printf("enter vaules for n and for x\n"); scanf("%d", &n); scanf("%d", &x); result=x+1; for(start=0, hezka;hezka<=n && start<=n;hezka++ && start++) { pow=power(hezka,x); azeret+=start; result+=pow/azeret; } printf("The Result is: %lf\n", result); }
|