Code

 Example 1

#include <stdio.h>
#include <stdlib.h>

int main (int argc, char * const argv[]) {
// insert code here...
int i,x,y;
int aRay[10];
int * bRay;

printf( "Hello, World!\n");
x=2;
if(x==2) y=3; else y=4;
bRay = malloc(10*sizeof(int));
bRay[1]=66;
bRay[x]=y;

// Print out bRay printf( "Hello, World aRay!\n");
for(i=0;i<10;i++)
printf("%d\n",aRay[i]);

// Print out bRay
printf( "Hello, World bRay!\n"); for(i=0;i<10;i++)
printf("%d\n",bRay[i]);

// Free the bRay resources free(bRay);
return 0;
}

Complex Example

 
#include 
#include 
typedef struct fraction_tag {
	int n;
	int d;
} Fraction;



void printFraction(Fraction c)
{
	printf("%d / %d \n",c.n,c.d);
}

Fraction addFraction(Fraction a,Fraction b)
{
	Fraction c;
	c.n = a.n*b.d+b.n*a.d;
	c.d=a.d*b.d;
	return c;
}

int main (int argc, char * const argv[]) {
    // insert code here...
    int i,x,y;
	int ar[10];
	int * br;
	
	printf( "Hello, World!\n");
	
	x=2;
	if(x==2) y=3;
	else y=4;
	
	br = malloc(10*sizeof(int));
	br[1]=66;
	br[x]=y;
	printf( "Hello, World Ar!\n");
	for(i=0;i<10;i++)
		printf("%d\n",ar[i]);
	printf( "Hello, World Br!\n");
	for(i=0;i<10;i++)
		printf("%d\n",br[i]);
    free(br);
	Fraction a;
	a.n=12;
	a.d=5;
	printFraction( a );
	
	Fraction * b = malloc(sizeof(Fraction));
	b->n=8;
	b->d=3;
	printFraction( *b );
	
	Fraction c=addFraction(	a	, *b);
	printFraction( c );
	
	free(b);
	
	printFraction (*b);
	printf("%x\n",b);
	
	return 0;
}