C Programming Basics

C programming is an imperative procedural language. It was designed to compiled using a relatively straightforward compiler and it also provides the access to memory to provide language constructs to follow the machine instructions.

In this section, you will learn how to start with c programming and also I will explain this by using a simple and easy example program which prints the “Hello World”. Apart from this, you will also learn the below things:

  • Basic commands of c programming.
  • How to write a C program.
  • A simple C program with an output.
  • How to compile and execute a C program.

Basic commands of c programming

Below are the basic commands of C programming language:

#include : A command for the preprocessor to include the standard input output header file(stdio.h) from C library.ng a C program
int main(): Main function, from where execution of C program begins.

How to compile and execute a C program

Follow the below steps to compile and execute the C programs.

Step 1) Go to the path where you have saved your C programs.

Step 2) Assume you have saved your C programs in D drive, then run this command to compile your program D:\C Programs>tcc hello.c

Step 3) After execution of “tcc command”, just type the program name and hit the enter button.

D:\C Programs>hello

Simple Example:


Program to accept input from user

Below program will take input from the user using scanf and print while program execute.

Program output:

Enter an integer
Integer entered by you is 50

C programming books

Below is the list of recommended c programming books for the beginners.

If you like FreeWebMentor and you would like to contribute, you can write an article and mail your article to [email protected] Your article will appear on the FreeWebMentor main page and help other developers.

Recommended Posts:

Article Tags: , , , , , , , ,