1. Introduction to C Language in Tamil || Tamil Pro Techniques ||

Tamil Pro Techniques
3 Aug 201806:34

Summary

TLDRThis video tutorial introduces the C programming language, highlighting its origins by Dennis Ritchie in 1972 and its classification as a low-level language. It covers the importance of header files for function utilization, such as 'stdio.h' for input/output operations and 'conio.h' for console-specific functions like 'getch' and 'clrscr'. The tutorial demonstrates creating a basic C program in Turbo C, emphasizing the structure of the 'main' function, the necessity of semicolons, and the use of 'getch' to prevent the output screen from disappearing. It also illustrates the consequences of omitting header files, showing errors that arise when 'printf', 'clrscr', and 'getch' functions are not supported due to missing 'stdio.h' and 'conio.h'.

Takeaways

  • 📘 The C language is a programming language used for communication with the system.
  • 👤 C language was founded by Dennis Ritchie in 1972.
  • 🔧 C is considered a low-level programming language.
  • 🖥️ C language is platform-dependent and works on specific platforms.
  • 📚 It was standardized by ANSI in 1989.
  • 📝 Header files in C are essential as they contain functions used in the program.
  • 📑 The '#include' directive is used to add header files to a C program.
  • 🔑 'stdio.h' is the standard input-output header file, and 'conio.h' is for console input-output.
  • 🔠 The 'main' function is the entry point of every C program, enclosed in braces.
  • 💬 The 'printf' function is used for printing output in C programs.
  • ⏏️ The 'getch' function is used to pause the output until a key is pressed by the user.
  • 🔄 The 'clrscr' function clears the screen to display only the current output.
  • ⚠️ If the header file 'stdio.h' is not included, the 'printf' function will not work.
  • 🛑 Errors will occur if 'conio.h' is not included, as it contains 'clrscr' and 'getch' functions.

Q & A

  • What is the purpose of a programming language?

    -A programming language is used to communicate with a system, allowing humans to give instructions that the system can understand and execute.

  • What is C language?

    -C language is a low-level programming language that was founded by Dennis Ritchie in 1972, used for a variety of programming tasks and known for its efficiency and portability.

  • Why is the C language considered a low-level language?

    -C language is considered low-level because it provides facilities for direct memory access and manipulation, allowing for system-level programming and close interaction with the hardware.

  • What does ANSI stand for and why is it significant in the context of C language?

    -ANSI stands for the American National Standards Institute. It is significant because in 1989, ANSI standardized the C language, ensuring consistency and compatibility across different platforms.

  • What are header files in C programming and why are they important?

    -Header files in C programming contain declarations of functions and variables that can be used in a program. They are important because they allow the program to access pre-defined functions and constants without having to redefine them.

  • What does the '#include' directive do in C programming?

    -The '#include' directive in C programming is used to include the contents of a header file into the current program, making the functions and constants declared in that header file available for use.

  • What is the main function in C and why is it necessary?

    -The main function is the entry point of a C program. It is necessary because every C program must have a main function where the execution of the program begins.

  • Why do we need to terminate each line of code in a C program with a semicolon?

    -Each line of code in a C program must be terminated with a semicolon to indicate the end of a statement. This is a syntactical requirement for the compiler to correctly parse the code.

  • What is the purpose of the 'getch' function in C programming?

    -The 'getch' function is used to wait for a single character input from the user. It is often used to prevent the console window from closing immediately after the program execution, allowing the user to see the output before the window closes.

  • What happens if you remove the 'stdio.h' header file from a C program that uses the 'printf' function?

    -If you remove the 'stdio.h' header file from a C program that uses the 'printf' function, the program will not compile successfully because the prototype for 'printf' is not included, resulting in a compilation error.

  • Why is the 'clrscr' function used in C programming?

    -The 'clrscr' function is used to clear the contents of the screen in a console application, allowing the program to display only the current output without the previous content remaining on the screen.

  • What errors would occur if the 'conio.h' header file is removed from a program that uses 'clrscr' and 'getch' functions?

    -Removing the 'conio.h' header file would result in compilation errors for the 'clrscr' and 'getch' functions because their prototypes and implementations are stored in the 'conio.h' header file.

Outlines

00:00

📝 Introduction to C Language and Programming Basics

The first paragraph introduces the C programming language, explaining it as a low-level language created by Dennis Ritchie in 1972 and standardized by ANSI in 1989. It discusses the importance of programming languages for communication with systems and mentions other languages like C++ and Java. The speaker guides viewers on how to start a basic C program using Turbo C, emphasizing the necessity of including header files such as 'stdio.h' for standard input/output functions and 'conio.h' for console input/output functions. The paragraph also covers the structure of a C program, including the main function, code blocks, and the use of the 'printf' function for output. It highlights the use of 'getch' to prevent the output screen from disappearing quickly and 'clrscr' to clear the screen, illustrating these concepts with a practical example.

05:00

🔍 Understanding the Role of Header Files in C Programming

The second paragraph delves deeper into the significance of header files in C programming. It demonstrates what happens when 'stdio.h' is removed, causing the 'printf' function to fail during execution, and underscores the need for including the appropriate header files for functions to work correctly. The paragraph also shows the consequences of removing 'conio.h', which leads to errors since 'clrscr' and 'getch' functions are part of this header file. The speaker encourages continuous watching of the video for further understanding and invites viewers to ask questions in the comments, ensuring they grasp the concept of header files and their role in a C program.

Mindmap

Keywords

💡Turbo C

Turbo C is an integrated development environment (IDE) and compiler for the C programming language. In the video, Turbo C is used as the platform to write and run C programs. The video shows how to start Turbo C and create a new file to begin coding in C, making it essential for beginners learning the language.

💡Programming Language

A programming language is a formal language used to communicate instructions to a computer. In the video, the term is introduced to explain that C is one of many programming languages, like C++ and Java, that allow humans to write programs that computers can execute.

💡C Language

C Language is a high-level programming language developed by Dennis Ritchie in 1972. It is described in the video as a low-level language that requires specific platforms to work. The video also highlights its significance by mentioning its standardization by ANSI in 1989, making it a foundational language for learning programming.

💡Header Files

Header files are files that contain definitions of functions and macros to be shared between several source files. In the video, the importance of including appropriate header files, such as stdio.h and conio.h, is emphasized, as they contain necessary functions like printf and getch. Without these files, the program cannot function correctly.

💡Void Main

Void Main is the starting point of a C program, where the execution begins. In the video, it is explained that every C program must have a main function, denoted by 'void main()'. The code inside this function is enclosed within curly braces, forming the core of the program.

💡Printf Function

The printf function is used in C to print formatted output to the screen. The video explains how to use this function to display messages, such as 'This is My first video'. It highlights the necessity of terminating each line with a semicolon and demonstrates how printf requires the stdio.h header file to function properly.

💡Getch Function

Getch is a function that pauses the output screen until a key is pressed by the user. In the video, it is used to prevent the output screen from disappearing immediately, allowing the user to see the program's output. The function is part of the conio.h header file, and its absence leads to errors in the program.

💡Clrscr Function

Clrscr stands for 'clear screen' and is used in C to clear the previous output on the console. In the video, this function is used to ensure that only the current output is visible on the screen. It is part of the conio.h header file, and the absence of this header file leads to errors.

💡ANSI Standard

The ANSI standard refers to the standardization of the C programming language by the American National Standards Institute in 1989. In the video, this is mentioned to highlight the importance of C as a language that has been formally recognized and standardized, making it widely accepted and used in various systems.

💡Curly Braces

Curly braces are used in C to define the beginning and end of code blocks, such as in functions. The video explains that all the program code within the 'void main' function is enclosed in curly braces, marking it as the code to be executed. This structure is essential for organizing and executing code correctly in C.

Highlights

Introduction to C language and its purpose for communication with the system through programming.

Overview of various programming languages including C, C++, and Java.

Historical context of C language, founded by Dennis Ritchie in 1972.

C language is a low-level language with platform dependencies.

Standardization of C language by ANSI in 1989.

Demonstration of writing a basic C program using Turbo C.

Explanation of header files and their importance in C programming.

Adding header files using #include directive for accessing functions.

Introduction to stdio.h and conio.h header files and their contents.

Understanding the main function and its role in a C program.

Use of printf function for printing output in C programs.

Requirement of semicolon to terminate each line of code in C.

Using getch function to pause the output and wait for user input.

Demonstration of output behavior with and without getch function.

Purpose of clrscr function to clear the screen in C programs.

Error handling when header files are not included in the program.

Importance of including stdio.h for using printf function.

Consequences of removing conio.h and its impact on clrscr and getch functions.

Encouragement for viewers to watch the video continuously and ask doubts in the comments.

Transcripts

play00:12

hello friends

play00:13

in last video we learn about how to download and install turbo c

play00:18

in this video we are going to learn about what is C language

play00:22

basically language is used for communication purpose

play00:26

in that way ,to communicate with the system we use language called programming language

play00:30

there are lot of programming language

play00:33

example c, c++ java etc.

play00:38

ok now we learn what is C Language

play00:47

it was founded by Dennis ritchie in 1972

play00:51

it is a low level language

play00:54

and also it depend some platform to work

play00:57

it works on some specific platform

play01:02

and in 1989 it was standardized by ANSI

play01:10

ok we do some basic program in c

play01:14

run your turbo c

play01:20

start turbo c

play01:32

give file ->New

play01:40

first we have to add our header files

play01:46

Because header files have some contents or functions.

play01:50

if the header files are not given, the contents or the function will not work

play01:54

There are so many header file,and each contains different function

play01:58

which functions you are going to use in the program add a respective header files

play02:03

now i am adding two header files

play02:23

By the use of #include we add a header file , it to our program

play02:29

stands for Standard input output .header

play02:33

there are some contents are stored in this header file

play02:38

stands for Console input output.header

play02:41

it also having some contents, we will see in this program

play02:46

each program have its main function

play02:49

so i am giving void main

play02:56

the braces denotes the fuction

play03:04

program coding are entered in the the curly braces

play03:09

it is called as code blocks

play03:12

we write some basic codings

play03:16

i am using printf function for printing purpose

play03:22

what you have to print in the output that message will be in double codes

play03:27

the message i am going to print is

play03:37

This is My first video

play03:39

Ok we given the meassage

play03:47

In C program each line is teriminate with

play03:51

semicolon

play03:51

each and every line in the code block have to end with semicolon

play03:56

then only it run successfully

play03:59

now i run the program

play04:02

there is no error for me

play04:03

but the output screen does not display[ it disappears in a fraction of seconds]

play04:07

so for this

play04:10

we use getch fuction

play04:12

this function, wait for getting a single character from the user

play04:17

now i am run the program

play04:21

there is two output

play04:24

the first is doesn't appear

play04:26

the second is appears because of using getch

play04:31

so the console(output) wait for a single key from the user

play04:34

if we give some key it exits the output

play04:37

i hope you may understand, that why we are giving getch function

play04:40

if i want to clear the last output and print the current output

play04:46

we have use clrscr -> clear Screen funtion

play04:49

now it show only the current output

play04:55

now i am give some character

play04:57

it exits

play05:00

let see what happen, if i remove the header file stdio.h

play05:07

i removed this header file

play05:10

if i run the program

play05:13

the printf function will not work during the execution

play05:16

because the function stored in stdio.h header file

play05:19

now i am run the program

play05:21

it shows an error

play05:23

printf function should have a prototype

play05:27

if we want to use printf function in our program

play05:30

we must include the respective header file

play05:41

now i am removing conio.h

play05:43

let see what happens

play05:45

if i run ,my clrscr and getch function will not work

play05:50

so i am run the program

play05:52

it show 2 error

play05:54

because the clrscr and getch functions were stored in the conio.h header file

play06:02

so i am giving that

play06:11

i hope ,you understand

play06:13

that why are we giving header files

play06:18

purpose of giving void main,clrscr,getch

play06:23

continuously watch the video

play06:25

drop your doubt in the comment

play06:27

thank you

Rate This

5.0 / 5 (0 votes)

相关标签
C LanguageProgrammingTurbo CHeader Filesstdio.hconio.hprintf FunctionCode TutorialGetch FunctionClrscr FunctionDennis Ritchie
您是否需要英文摘要?