Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
First C Language Program - c1
#1
Thumbs Up 
In C, the program to print "hello, world"is

#include <stdio.h>


main()
{
printf("hello, world\n");
}


Just how to run this program depends on the system you are using. As a specific example, on the UNIX operating system you must create the program in a file whose name ends in ". c", such as hello. c, then compile it with the
command.

cc hello.c

If you haven't botched anything, such as omitting a character or misspelling something, the compilation will proceed silently, and make an executable file called a. out. If you run a. out by typing the command.

a.out

it will print

hello, world
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)