Sie sind auf Seite 1von 3

C Introduction

• C is a high level, structured oriented, general-purpose programming language


• C developed by Dennis Ritchie at AT&T Bell Labs, USA in 1972
• C is basis for Java, C++

• Today C is the most widely used and popular System Programming Language.

Some Facts About C Programming Language


• In 1988, the American National Standards Institute (ANSI) had
formalized the C language.

• C was invented to write UNIX operating system.

• C is a successor of 'Basic Combined Programming Language' (BCPL) called B


language.

• Linux OS, PHP, and MySQL are written in C.

• C has been written in assembly language.

Uses of C Programming Language


In the beginning, C was used for developing system applications, e.g.:
• Database Systems
• Language Interpreters
• Compilers and Assemblers
• Operating Systems
• Network Drivers
• Word Processors
Why to Learn C Programming?
Some of the key advantages of learning C Programming:

• One of the early programming languages.


• Still, the best programming language to learn quickly.
• C language is reliable, simple, and easy to use.
• C language is a structured language.
• Modern programming concepts are based on C.
• It can be compiled on a variety of computer platforms.
• C is the building block for many other programming languages.
• Programs written in C are highly portable.

What is Compiler in C?
A compiler is a computer program that transforms human-readable (programming
language) source code into another computer language (binary) code.
In simple terms, Compiler takes the code that you wrote and turned in to the binary
code that the computer can understand.

The first C Program


#include <stdio.h>

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

• The program simply prints the words "hello, world" on the screen (standard
output)
• C commands are all lower case
The Program line by line
#include <stdio.h>

Tells the C compiler to include the library header file stdio.h in the program. This
file contains several functions to do with input and output. The function printf() is
in this library routine. If stdio.h was not included in the program, C would not be
able to find the printf() function

main()
{
}

main() is a the name of a user-defined function. C looks for a function with this
name to start execution. If main() is missing from the program, C will generate an
error message at compile time

The curly brackets (braces) indicate to C the statements that make up the function

The braces do not have to be on separate lines


#include <stdio.h>

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

But , be clear - as programs get longer the above makes then unreadable!
printf("hello, world\n");

A library function that instructs C to print the character string on the screen
(standard output)

All statements are separated by ;

\n is an escape character - it represents the newline character

C does not generate newlines automatically. We could just as easily have written
printf("hello, ");
printf("world");
printf("\n");

This would have produced the same output.

Das könnte Ihnen auch gefallen