Source Code
-----------

/*
   Name : Helmi bin Ibrahim
   IC UiTM : 2000208796
   Group : B
*/

#include

void intro(void);
void user_input(void);
float power(float,float);

main ()
{
	intro();
	user_input();
	return 0;
}

/* Introduction to the program */
void intro(void)
{
	printf("\n\n \"Welcome to Helmi\'s program\" \n\n");
	printf("This program will calculate \n");
	printf("--------------------------- \n");
	printf("the power delivered by a voltage source \n");
	printf("--------------------------------------- \n\n");
}

/* User will input value of current and voltage */
void user_input(void)
{
	float current,voltage,answer;

	printf("Please input the value for\n");
	printf("Current, I= ");
	scanf("%f",¤t);
	printf("Voltage, V= ");
	scanf("%f",&voltage);

	answer=power(current,voltage);
	printf("\nPower,   P=%f W\n\n",answer);
}

/* The formula used to obtained the power */
float power(float I,float E)
{
	float P;
	P=I*E;
	return P;
}


Examples of the output
---------------------
output (1)


 "Welcome to Helmi's program"

This program will calculate
---------------------------
the power delivered by a voltage source
----------------------------------------

Please input the value for
Current, I= 3
Voltage, V= 18

Power,   P=54.000000 W


output (2)


 "Welcome to Helmi's program"

This program will calculate
---------------------------
the power delivered by a voltage source
----------------------------------------

Please input the value for
Current, I= 1.2
Voltage, V= 50.51

Power,   P=60.612000 W


    Source: geocities.com/helmi03