//Functions
#include <stdio.h>
void sayhello(void);//prototype
void weather(void);//prototype
void add(int,int);//prototype
void subtract(int,int);//prototype
int multiply(int, int);//prototype
int squared(int);
void main()
{
	int x, y, z,total,total2,total3;
	x = 6;	y = 4;	z = 3;
	printf("Welcome to my program\n");
	sayhello();	sayhello();	weather();	sayhello();	add(x,y);	add(x,z);	add(y,z);	subtract(x, y);	subtract(x, x);
	
	total=multiply(x, y);//call
	printf("The result was %d\n", total);

	total2 = multiply(y, z);//call
	printf("The result was %d\n", total2);

	total3 = total + total2;
	printf("Overall total: %d", total3);

	x = squared(x);
	y = squared(y);
	printf("%d\n", x);
	printf("%d\n", y);
	printf("End of program\n");
}

int squared(int x)
{
	x = x*x;
	return x;
}


int multiply(int x,int y)
{
	int total;
	total = x*y;
	return total;
}

void add(int x,int y)
{
	int total;
	total = x + y;
	printf("The total was %d\n", total);
}

void subtract(int x, int y)
{
	int total;
	total = x - y;
	printf("The total was %d\n", total);
}


void sayhello()
{
	printf("Greetings :)\n");
}

void weather()
{
	printf("Today is looking sunny\n");
}
