0% found this document useful (0 votes)
6 views13 pages

Lecture 2

Uploaded by

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

Lecture 2

Uploaded by

5z8jttgwl
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 13

01

02

C Language
LECTURE 2
04
Today’s Agenda
01
Writing The First “C” Program

02
What are Header Files ?

03
What is “stdio.h” and why do we use it ?

04
What is “conio.h” and why do we use it ?
Writing The First “C” Program

#include <stdio.h> Turbo C page


#include <conio.h>

void main()
{
clrscr();
printf(“Hello User”);
}
What are Header Files ?

❑ What are header files and why do we use them ?

1. Header file are those files which have the extension .h in C/C++ languages.

2. These header files are created by the company which design the IDE of
C language, in our case it is BORLAND.
What are Header Files ?

3. These header files contain a huge collection of predefined programs which are
called as FUNCTION.

4. For Example: All the mathematical functions like sqrt(), pow(), sim(). Con(), tan(),
log() etc are available in a header file called math.h.
What are Header Files ?

5. Similarly all the functions for drawing various figure on screen are available in a
header file called graphics.h like circle(), rectangle(), polygon(), ellipse(), bar() etc

6. Now if a programmer wants to simplify his programming efforts and wants to


write the program quickly then he has to use these functions. But to use these
functions we must attach their respective header files in our program and to do
this C language gives us a command called #include.
What is “stdio.h” and why do we use it ?

❑ What is stdio.h and why do we use it ?

1. The word “stdio.h” stands for Standard Input Output

2. In programming the word std input refers to keyboard and the word
std output refer to monitor (screen).
What is “stdio.h” and why do we use it ?

3. Thus the word stdio.h stands for standard input output, h and this header file
provides we to very important activities.

4. These activities are input (accepting data from the user) and output (displaying
result on the screen).
What is “stdio.h” and why do we use it ?

5. For input we get a function called as scanf() and for output we get a function
called printf().

6. Since almost every program performs input and output activities so the header
file stdio.h is also used by almost every C program.
What is “conio.h” and why do we use it ?

❑ What is “conio.h” and why do we use it ?

The term conio stands for console input output and in programming the
word console means OUTPUT window i.e. the window where the result of
execution of out program is displayed.
What is “conio.h” and why do we use it ?

Although the header file conio.h does not generate the CONSOLE window
for us, because CONSOLE is automatically provide by the OS.

However, the file conio.h provids us some very useful function which will
help us control/manage the console window. These most
popular functions are:
What is “conio.h” and why do we use it ?

1. clrscr() : Used for clearing the console window

2. textcolor() : Used for changing the font color on console window

3. gotoxy() : Used for changing the cursor position on console window

4. getch() : Used pausing the console window.


End of Lecture 2

Thank you

You might also like