Introduction
The C program you write is called source code. A compiler translates C source code into machine language. Computers are made up of nothing more than thousands of electrical switches that are either on or off. Therefore, computers must ultimately be given instructions in binary. The prefix bi- means “two,” and the two states of electricity are called binary states. It’s much easier to use a C compiler to convert your C programs into 1s and 0s that represent internal on and off switch settings than for you to do it yourself.
Basic Steps To Follow When Writing A Program
1. Decide exactly what the program should do.
2. Use an editor to write and save your programming language instructions. An editor lets you create
and edit text.
3.All the popular C compilers include an integrated editor along with the programming language compiler.
4.All C program filenames end in the .c file extension.
5. Compile the program.
6. Check for program errors. If any appear, fix them and go back to step 5.
7. Execute the program.
READ ME !!
* C programming has several inbuilt library functions to perform input and output tasks.
The two commonly used functions for input/output tasks are....
a) printf()
b) scanf()
* The scanf() function reads formatted information from standard input(keyboard).
* The printf() function sends formatted output to the standard output (screen).
* Header File is a file that contains function declaration and macro definition for c in-built library
All C standard library functions are declared in many header files which are saved as file_name.h
We are including these header files in our C program using “#include <file_name.h>” command to make use of the functions those are declared in the header files.
The two commonly used functions for input/output tasks are....
a) printf()
b) scanf()
* The scanf() function reads formatted information from standard input(keyboard).
* The printf() function sends formatted output to the standard output (screen).
* Header File is a file that contains function declaration and macro definition for c in-built library
All C standard library functions are declared in many header files which are saved as file_name.h
We are including these header files in our C program using “#include <file_name.h>” command to make use of the functions those are declared in the header files.
When we include header files in our C program using “#include <filename.h>” command, all C code of the header files are included in C program. Then, this C program is compiled by compiler and executed.
* #include<stdio.h>
it represents standard input/output function which contains printf(), scanf() functions.
* #include<conio.h>
conio. h stands for console input and output header file. This is a library function which is used for output and input functions.
The symbol # is known as preprocessor
Include is a directory and all the header files like stdio.h , conio.h are kept.
* clrscr(): [clear screen]
This is used to clear previous output in the output window. If you don't use it in your program then the output window will become messy.
* getch(): [hold screen]
This function is used to hold the output window, otherwise when we run code it will display the output for just a fraction of seconds.
Comments
Post a Comment