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 8425277
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T04:13:35+00:00 2026-06-10T04:13:35+00:00

I wrote little program to print Hello world in C. I’m not a C

  • 0

I wrote little program to print “Hello world” in C. I’m not a C programmer, but I liked to try it. In my program there is an error. Please tell me what is it?
This is my program:

int main(){
    printf("Hello World");
}

I wrote this with my Java Experiences. I can’t find what is wrong.

  • 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-10T04:13:37+00:00Added an answer on June 10, 2026 at 4:13 am

    You can’t directly use printf() function as in Java. You should tell the compiler that you are going to use the input/output stream. You can tell it in this line:

    #include <stdio.h>
    

    and also you should enter this line at the end of the source code:

    return 0;
    

    this will tell the compiler :

    “If the program succeed It will return 0 otherwise It will return any other number”

    This means if your program is successful main() function will return 0. Then the compile know the program is Ok.

    Then at last your complete code is:

    #include <stdio.h>
    
    int main() {
        printf("Hello world");
        return 0;
    }
    

    To compile this and see the word “Hello World”, just save this file as a .c file and Open cmd in your program directory and type

    gcc hello.c -o hello && hello
    

    (Replace the ‘hello.c’ with your filename, and ‘hello’ with the name you want to put with your .exe file)

    Remember My computer is Windows. And this compile code is for windows. If your OS is UNIX like OS. then use this code to compile:

    gcc hello.c -o hello
    ./hello
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I wrote a little test program but I'm experiencing a syntax error in my
I'm a little bit confused about simple program which I wrote, can You please
I wrote a little program which prints help information if argument is not passed.
I wrote a nice little program. At some point, it is required to load
I wrote a little program that use activemq embedded broker. Program run on one
I wrote a little program that solves 49151 sudoku's within an hour for an
I wrote a little program to do generalized caesar ciphers. I can't figure out
I wrote a little Haskell program to find the area of a triangle, primarily
I am a little curious why the program I wrote on Xcode with a
I wrote a little Python program that looks though a directory (and its subdirectories)

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.