Simple C Program
#include
int main()
{
/* my first program in C */
printf("Hello, World! \n");
return 0;
}
1. The first line of the program #include is a preprocessor command, which tells a
C compiler to include stdio.h file before going to actual compilation.
2. The next line int main() is the main function where the program execution
begins. 3. The next line /*...*/ will be ignored by the compiler and it has been put
to add additional comments in the program. So such lines are called comments in
the program.
3, PROGRAM STRUCTURE C Programming 7
4. The next line printf(...) is another function available in C which causes the
message "Hello, World!" to be displayed on the screen.
5. The next line return 0; terminates the main() function and returns the value 0#include include information about standard library
main() define a function called main that received no argument values
{ statements of main are enclosed in braces
printf("hello, world\n"); main calls library function printf
to print this sequence of characters
\n represents the newline characterCis a general-purpose programming language.
C was developed by Dennis Ritchie at “AT & T’s Bell Laboratory”
and was originally implemented in 1972.
The C language was evolved from B. Which was developed by Ken
Thomson but it was interpreter based but it was very slow so
Dennis Ritchie modified the "B" Language and named it as "C
he is also called as father of C Programming language
Cinitially became widely known as the development language of
the UNIX operating system. Many of today’s leading operating
systems are written in C and/or C++.
It’s possible to write C programs that are portable to most
computers.
Cis used for writing programs in many different domains, such as
operating systems, numerical computing, graphical applications,
etc.
Cis widely used to develop systems that demand performance,
such as operating systems, embedded system