problem with function

im unable to link these two bodies..i try to use function...can someone help me or edit the code...thank you so much

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
  #include "stdio.h"

int kuasaDua (float,float);

int main ()
{
	float a,b,j;
	printf("masukkan nombor\n");
	scanf("%f",&a );
	
	
	
	kuasaDua (a,b);
	printf("%1.1f kuasa dua ialah %2.1f\n",a,b);
	
	
}

	int kuasaDua(float a,float b)
{

	kuasaDua=a*a;
	kuasaDua=b;
	return kuasaDua;
	
}
You don't get as far as linking; your code does not even compile to object code.

'b' is used without initialization.
Return value of function 'kuasaDua' is not stored in a variable.
There is no variable named 'kuasaDua' declared within the scope of function 'kuasaDua'.

This site has a Tutorial. It does show the basic usage of functions. Please read.
Last edited on
Topic archived. No new replies allowed.