In this "C" tutorial basically, we provide different C programs that helps a beginner to write C program easily and create a C project of his own.
History
In the year of 1972, Dennis Ritchie has developed "C" programming language at AT and T Bell laboratories for developing system software.
Hello World Example
let's start with a simple Hello program.
Hello.c
# include <stdio.h>
# include <conio.h>
int main()
{
printf("Hello");
return 0;
}
Description Of Hello World Example
The stdio.h is a header file which provide standard input output library function like printf(), scanf() etc. To use the file, we need to include it in our program using #include preprocessor.
The main() function
In C code execution begins from main() function ( put main() function anywhere in the program ).
The code inside the curly braces { } is the body of main() function. The main() function is mandatory in C program.
Hello.c
int main()
{
//code;
}
This program doesn’t do anything but, it’s a valid C program.
The printf() function
The printf() is a library function that sends formatted output to the screen (displays the string inside the quotation mark). semicolon at the end of the statement is mondatory.
In our program, it displays Hello, World! on the screen.
Remember, we need to include stdio.h file in your program for this to work.
The return statement
Every function in c return the value and main() is also a function so it returns the value.therefore we have to write return statement but if we put void return type then no need to write return statement.
Ready to get started?
Replenish him third creature and meat blessed void a fruit gathered you’re, they’re two waters own morning gathered greater shall had behold had seed.