0% found this document useful (0 votes)
5 views6 pages

Introduction to C Programming Basics

The document provides an introduction to the C programming language, developed in 1972 by Dennis M. Ritchie for UNIX. It includes a simple example program, explaining its structure, which consists of preprocessor commands, functions, variables, statements, and comments. Key functions such as printf(), scanf(), clrscr(), and getch() are also discussed, emphasizing the importance of the main() function as the entry point of any C program.

Uploaded by

abhishek7feb
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views6 pages

Introduction to C Programming Basics

The document provides an introduction to the C programming language, developed in 1972 by Dennis M. Ritchie for UNIX. It includes a simple example program, explaining its structure, which consists of preprocessor commands, functions, variables, statements, and comments. Key functions such as printf(), scanf(), clrscr(), and getch() are also discussed, emphasizing the importance of the main() function as the entry point of any C program.

Uploaded by

abhishek7feb
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

Intro -

The C is a general-purpose, high-level


language developed in 1972 by Dennis M.
Ritchie at
AT & T’s Bell Labs to develop the UNIX
operating system.
Example
Just open the Turbo C++ and write the
following code…
#include <stdio.h>
#include <conio.h>
int main( )
{
/* My first program in C language. */
clrscr );
printf("Hello, World! \n");
getch( );
return 0;
}
Now press ALT+F9 to compile and
CTRL+F9 to run it.
Its structure

A C program basically consists of the following


parts:
 Preprocessor Commands

 Functions

 Variables

 Statements & Expressions

 Comments

Here…
# : is a preprocessor
directive.
include : is a preprocessor
command.
stdio.h : is a header file.
conio.h : is a header file.
Facts:
a) The stdio.h stands for Standard Input
Output and it contains the declaration of
printf( ) and scanf( ) functions.
b) The conio.h stands for Console Input
Output and it contains the declaration of
clrscr( ) and getch( ) functions.

main()
{

}

A program must contain at least a single


function that is main() because the execution
of any program start from main().
Facts:
a) The main() function is always called by an
Operating System.

/* My first program in C language. */


This is a comment and we can use it to write
something that will be ignored by C compiler.

clrscr();
This is a function and we can use it to
clear the last output on the screen.

printf();
This is a function and we can use it to
insert any text string on the screen.

scanf();
This is a function and we can use it to
accept anything from the keyboard.

getch();
This is a function and we can use it to
accept a character input from the keyboard.

You might also like