Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8088087
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T18:59:16+00:00 2026-06-05T18:59:16+00:00

I am wondering why my C program does not print any information. I am

  • 0

I am wondering why my C program does not print any information. I am 100% new to programming, and have been able to learn a few things in Ruby and Python these past few weeks, but I am getting nowhere with the C stuff. Here is the total baseline, simple program that everyone learns first:

#include <stdio.h>

int main()

    {
        printf("Hello World\n");
        return 0;
    }

So I’ve got that written, and I save as hello.c. Now I cd to the directory where it is, and then I try

gcc hello.c

and nothing happens – no errors, just nothing. If I write instead

gcc hello.c -o hello

a new executable file is written to my directory, and when I open it, it looks like the normal command line, and has “Hello World” written there, as I expected in my terminal the first time.

I also tried make hello.c an executable itself, but when I do that I get

syntax error near unexpected token `('
`int main()'
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T18:59:16+00:00Added an answer on June 5, 2026 at 6:59 pm

    When you type

    gcc hello.c
    

    and nothing happens, that is to be expected. Or more precisely, GCC will compile an executable with the default name, which for me is a.out. If I were then to type ./a.out on the command line, I see the output.

    I think there may be a slightly bigger conceptual issue here though from your Ruby/Python background. Ruby and Python are (usually) interpreted languages, which means that when you create a script file, you can mark it as executable and through some magic the OS will start up a program that reads the files and executes them for you. C, however, is compiled. So when you run GCC, that takes your source file and turns it into an executable, with either the default or specified name. At this point, one would not expect to see any output unless there is a problem with the compilation process. Then you can run ./hello, which is an executable, and see your output.

    That also explains why you can’t mark hello.c as executable and run it. It needs to be compiled into an executable first. It looks like the system is pretending it’s a shell script, which is isn’t, and giving you a syntax error.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a program that displays and inventory report and i was just wondering
Just wondering if someone could explain this to me? I have a program that
In the program I have pasted below, I was just wondering why the pointer
My 7 year old would like to learn, how to program? (his idea not
Our VB6 program currently calls code in a C++ dll. This dll does not
I am not really familiar with Maven program but I've been using Eclipse for
I am wondering how this happens: how is a Java program mapped to an
I was wondering if it is possible for a program to prompt the user
I was wondering ( if possible ) if there was a program/tool/utility that when
I was wondering if there is a library for editing program flow. I refer

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.