View Single Post
Old Jul 18th, 2005, 12:16 PM   #1
mesagsxbkr
Newbie
 
Join Date: Jul 2005
Posts: 1
Rep Power: 0 mesagsxbkr is on a distinguished road
Segmentation Fault!!!

I have some background in programming and i have to take this programming class for school. Anyway I was trying to run this program and when I compile it with gcc it compiles with no errors. But then when I try to run the program it returns with "Segmentation Fault". I tried to find out where the error was, but I am having no luck...i know this is a simple program but can you guys try to help me out? This is the code..

/*************************
*This program is creating*
*A table of Olympic*******
*Running distances********
*************************/
#include <stdio.h>
int main()
{
double a=100, b=200, c=400, d=800;
printf(
"Table of Olympic Running Distances\n"
"__________________________________________\n"
"%6s%20s%20s%20s\n"
"%6.0f%20.3f%20.3f%20.3f\n"
"%6.0f%20.3f%20.3f%20.3f\n"
"%6.0f%20.3f%20.3f%20.3f\n"
"%6.0f%20.3f%20.3f%20.3f\n"
"Meters", "Kilometers", "Yards", "Miles",
a, a*0.001, a*1.094, a*0.0006215,
mesagsxbkr is offline   Reply With Quote