Category: 02. C
-
Basic Syntax
In C programming, the term “syntax” refers to the set of rules laid down for the programmer to write the source code of a certain application. While there is a specific syntax recommended for each of the keywords in C, certain general rules need to be followed while developing a program in C. A typical source…
-
User Input
Need for User Input in C Every computer application accepts certain data from the user, performs a predefined process on the same to produce the output. There are no keywords in C that can read user inputs. The standard library that is bundled with the C compiler includes stdio.h header file, whose library function scanf() is most commonly…
-
Identifiers
Identifier in C helps in identifying variables, constants, functions etc., in a C code. C, being a high-level computer language, allows you to refer to a memory location with a name instead of using its address in binary or hexadecimal form. C Identifiers Identifiers are the user-defined names given to make it easy to refer to the memory. It is…
-
Keywords
Keywords are those predefined words that have special meaning in the compiler and they cannot be used for any other purpose. As per the C99 standard, C language has 32 keywords. Keywords cannot be used as identifiers. The following table has the list of all keywords (reserved words) available in the C language: auto double int…
-
Tokens in C
A token is referred to as the smallest unit in the source code of a computer language such as C. The term token is borrowed from the theory of linguistics. Just as a certain piece of text in a language (like English) comprises words (collection of alphabets), digits, and punctuation symbols. A compiler breaks a C program…
-
Comments in C
Using comments in a C program increases the readability of the code. You must intersperse the code with comments at appropriate places. As far as the compiler is concerned, the comments are ignored. In C, the comments are one or more lines of text, that the compiler skips while building the machine code. The comments in C play an…
-
Compilation Process in C
C is a compiled language. Compiled languages provide faster execution performance as compared to interpreted languages. Different compiler products may be used to compile a C program. They are GCC, Clang, MSVC, etc. In this chapter, we will explain what goes in the background when you compile a C program using GCC compiler. Compiling a…
-
Hello World
Every learner aspiring to become a professional software developer starts with writing a Hello World program in the programming language he/she is learning. In this chapter, we shall learn how to write a Hello World program in C language. Hello World in C Language Before writing the Hello World program, make sure that you have…
-
Program Structure
A typical program in C language has certain mandatory sections and a few optional sections, depending on the program’s logic, complexity, and readability. Normally a C program starts with one or more preprocessor directives (#include statements) and must have a main() function that serves as the entry point of the program. In addition, there may be global declarations of variables and functions, macros, other…
-
Environment Setup
To start learning programming in C, the first step is to setup an environment that allows you to enter and edit the program in C, and a compiler that builds an executable that can run on your operating system. You need two software tools available on your computer, (a) The C Compiler and (b) Text Editor.…