





![]() | Today | 1 |
![]() | Yesterday | 0 |
![]() | This week | 1 |
![]() | Last week | 0 |
![]() | This month | 1 |
![]() | Last month | 0 |
![]() | All days | 4219 |
Your IP: : 38.107.179.234
,
Today: May 21, 2012
Site Partners
Tracker
| A First C Program |
|
The first example program in K&RC is the first example program in any language: print or display a simple string, and exit. Here is my version of K&RC's program: /*C Program to display string*/ #include<stdio.h> #include<conio.h> void main() { clrscr(); printf("My name is Bibek.\n"); getch(); }
The first line is practically boilerplate; it will appear in almost all programs we write. It asks that some definitions having to do with the "Standard I/O Library'' be included in our program; these definitions are needed if we are to call the library function printf correctly. The third line says that we are defining a function named main. The braces {and} surround a list of statements in C. clrscr(); clears the screen of previous output. The line printf ("Hello, world! \n"); |
A First C Program





