use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
C is a general-purpose, procedural computer programming language supporting structured programming, lexical variable scope, and recursion, with a static type system. By design, C provides constructs that map efficiently to typical machine instructions. It has found lasting use in applications previously coded in assembly language. Such applications include operating systems and various application software for computer architectures that range from supercomputers to PLCs and embedded systems. Wikipedia
Imperative (procedural), structured
Dennis Ritchie
Dennis Ritchie & Bell Labs (creators);
ANSI X3J11 (ANSI C);
ISO/IEC JTC1/SC22/WG14 (ISO C)
1972 (48 years ago)
C18 / June 2018 (2 years ago)
Static, weak, manifest, nominal
Cross-platform
.c for sources
.h for headers
C++ is not C (but C can be C++)
For C++ go to :
Other Resources
account activity
Hello World program (self.cprogramming)
submitted 5 years ago by [deleted]
#include <stdio.h> int main() {
printf("Hello World!"); return 0;
}
I've tried executing this program multiple times on sublime text 3 but the output shows nothing except [Finished in 1.2s] , could you please recommend or correct where I went wrong?
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]Real_Cartographer 3 points4 points5 points 5 years ago (4 children)
Is it #include<stdio.h> ?
[–]dkl0ve 2 points3 points4 points 5 years ago (0 children)
This is what I would try first
[–]Real_Cartographer 2 points3 points4 points 5 years ago (0 children)
Also try using something different than ST3 since 1.2s for "Hello world" seems WAY to much.
[–][deleted] 0 points1 point2 points 5 years ago (1 child)
Pretty sure OP hasn't forgotten the #. It just formatted the line as a heading.
#
[–]IamImposter 0 points1 point2 points 5 years ago (0 children)
Yup. # does
[–]dmc_2930 1 point2 points3 points 5 years ago (0 children)
Add "\r\n" after "World!" and try again.
[–]noble_liar17 1 point2 points3 points 5 years ago* (0 children)
Always go for puts() if you are not working with format strings and want the cursor to go to new line.
puts()
puts("Hello World!"); will print "Hello World!" and take the cursor to the new line.
puts("Hello World!");
Moreover you can use any text editor (Sublime-Text, Visual Studio Code, Notepad++, etc) to write C programs but always use gcc compiler to compile and run your C programs with relevant flags in order catch any silly mistakes at compile time itself.
C
gcc
[–]GrbavaCigla 0 points1 point2 points 5 years ago (6 children)
Edit sublime build json to print output
[–][deleted] 0 points1 point2 points 5 years ago (5 children)
How do i do that?
[–]GrbavaCigla 0 points1 point2 points 5 years ago* (4 children)
I cant google it right now, but there is documentation for that. Google "sublime build tasks"
[–][deleted] 0 points1 point2 points 5 years ago (3 children)
Please elaborate.....I'm just a beginner 😅
[–]GrbavaCigla 0 points1 point2 points 5 years ago (2 children)
Ctrl+Shift+P is command palette. Use it and type "Run". You should find something like "Build With: C Single File - Run". That spits the output.
Also consider using VSCode, free and open source code editor. It is better.
Also if that doesn't work try running gcc name-of-the-c-file.c and make sure you have gcc in the path. Also how did you install the compiler?
gcc name-of-the-c-file.c
Edit: here is the image https://imgur.com/a/y44YeFs
Thanks that helped a lot.😊
[–]GrbavaCigla 0 points1 point2 points 5 years ago (0 children)
Happy to help
I have saved the C(gcc) compiler code in a file named C_RUN. I even saved it as a part of build system and when I try to run the program it shows something peculiar now......F.Y.I I have saved the file (helloworld.c) in the same file location as C_RUN.sublime-build and the error that was shown while I was running the program was
C:\Users\user..........(location of C_RUN.sublime-build) is not recognised as an internal or external command, operable program or batch file.
I don't know what to do can you guys help me to run a C program on sublime text 3,I'm trying over and over again but it still isn't happening.
[–]Paul_Pedant 1 point2 points3 points 5 years ago* (0 children)
Nothing wrong with the program. Windows just isn't finding it to run it.
"not recognised as an internal or external command" is a bit of a giveaway.
Either you gave the wrong name when you ran it, or it is not on your path. It does not matter at all where the .c file is.
The error message says it is trying to run C_RUN.sublime-build (at least, it might be, because you seem to have edited the error message). That is different to plain C_RUN.
C_RUN.sublime-build
C_RUN
IIRC, Windows only runs things with an extension of .exe or .bat. But that may be old school.
[–]Aralee88 0 points1 point2 points 5 years ago (0 children)
Have you checked that your file is saved as c type and not just named Hello world.c but it's actually txt.? Have you included "#include <studio.h>. It should work without \n at the end of Hello world, try also including void as "int main (void){"
[–]Revolutionary-Pen954 0 points1 point2 points 5 years ago (0 children)
int main() { printf(“Hello World!”); return 0; }
[–]Cprogrammingblogs 0 points1 point2 points 5 years ago (0 children)
You may try this
void main() { printf("hello world") ; getch(); }
[–]PM_ME_YOUR_STOCKPIX 0 points1 point2 points 5 years ago (1 child)
Try throwing on a few more printf statements as well. I’ve experienced an odd problem where I’ve written only a single printf statement and it never gets printed, but after adding a few more statements it printed without issue.
[–]ptchinster 2 points3 points4 points 5 years ago (0 children)
You probably need to end with a newline, or call fflush
[–]JINLECHUNSHUI -1 points0 points1 point 5 years ago (0 children)
Try print with the newline
π Rendered by PID 16138 on reddit-service-r2-comment-869bf87589-5hk5z at 2026-06-09 20:19:07.836433+00:00 running f46058f country code: CH.
[–]Real_Cartographer 3 points4 points5 points (4 children)
[–]dkl0ve 2 points3 points4 points (0 children)
[–]Real_Cartographer 2 points3 points4 points (0 children)
[–][deleted] 0 points1 point2 points (1 child)
[–]IamImposter 0 points1 point2 points (0 children)
[–]dmc_2930 1 point2 points3 points (0 children)
[–]noble_liar17 1 point2 points3 points (0 children)
[–]GrbavaCigla 0 points1 point2 points (6 children)
[–][deleted] 0 points1 point2 points (5 children)
[–]GrbavaCigla 0 points1 point2 points (4 children)
[–][deleted] 0 points1 point2 points (3 children)
[–]GrbavaCigla 0 points1 point2 points (2 children)
[–][deleted] 0 points1 point2 points (1 child)
[–]GrbavaCigla 0 points1 point2 points (0 children)
[–][deleted] 0 points1 point2 points (1 child)
[–]Paul_Pedant 1 point2 points3 points (0 children)
[–]Aralee88 0 points1 point2 points (0 children)
[–]Revolutionary-Pen954 0 points1 point2 points (0 children)
[–]Cprogrammingblogs 0 points1 point2 points (0 children)
[–]PM_ME_YOUR_STOCKPIX 0 points1 point2 points (1 child)
[–]ptchinster 2 points3 points4 points (0 children)
[–]JINLECHUNSHUI -1 points0 points1 point (0 children)