//Calculate time taken for light to reach Jupiter

#include <stdio.h>

#define LIGHTSPEED 186000

void main()
{
	float time,earthdistance,jupiter;
	earthdistance = 93000000;
	jupiter = 5.2;//Astronomical unit Earth is 1 AU

	time = earthdistance / LIGHTSPEED;
	
	printf("The time taken for light to reach Earth is %.2f seconds\n\n", time);

	time = time * jupiter;

	printf("The time taken for light to reach Jupiter is %.2f seconds\n\n", time);

}

OR 

#include <stdio.h>

#define LIGHTSPEED 186000

void main()
{
	float time,earthdistance,jupiterdistance;
	earthdistance = 93000000;
	jupiterdistance = 485000000;
	
	time = earthdistance / LIGHTSPEED;
	
	printf("The time taken for light to reach Earth is %.2f seconds\n\n", time);

	time = jupiterdistance / LIGHTSPEED;

	printf("The time taken for light to reach Jupiter is %.2f seconds\n\n", time);

}