What is C ?
C is a programming language which was developed in the year 1972 by Dennis Ritchie.
C is considered to be a low level programming language. Low level programming language is nothing but that provides no abstraction of programming concepts .C is considered as a low level language because they have no automatic memory management .But, I would classify C as an intermediate language because we don’t write machine codes in C .
Working of C :-
First we write a code and save it using filename.c
Compiles the source code.
a. We use compiler to convert the source code into object file
(filename.o or filename.obj) which will be convenient for machine to read i.e, machine
readable
Linking the object files
a. After compiler has converted into a object file it will use linker to combine different
object files and make it be a single file which will be executable file (filename.exe )
and will run the program.
Know about some of the header files used in C :-
Let’s look at a simple program in C :-
#include <stdio.h>
int main()
{
printf("Welcome to code house of C ");
return 0;
}
Algorithm :-
Start
Include the header file #include<stdio.h>
Explanation:- This header file will have standard input and output function .
For Example:- The header file has printf function .
Declare a main function int main()
Explanation:- This function is mandatory whenever you write a code in C. The block will directly get into the main function
Here you can just display a text message called Welcome to code house of C
.For this you can use printf function.
Explanation:- Since, we are displaying a text it’s called string and we have to use (" ") to write the text and display it using printf function
5. Since, we are using int main()
Explanation:- It has return type and we have to return 0 since it does not need to return anything
6. Stop
Screenshot:-
1.Code Screenshot:-
2.Output Screenshot:-
3 Comments
Thank you blogger..!!🤩🔥
ReplyDelete🔥🔥🔥🔥
ReplyDeleteVery nice explanation.l
ReplyDelete