C language provides a capability called ‘array’ that enables the user to design a set of similar data types. Very often, one needs to process collections of related data items, such as addition of fifty numbers, test scores of students in a university, a set of measurements resulting from an experiment, income tax tables, etc. […]
Archives for August 2021
Basics of C Functions
Fundamentals of functions There are basically two types of functions in C. Library functions User-defined functions The commonly required functions written, compiled, and placed in libraries are called “Library Functions”. Some examples of library functions are printf() and scanf() etc. The functions written by the user are termed as “User-Defined Functions”. In user-defined functions, the […]
C while, do-while and for Loops
C programming language provides two types of control statements. Selection or Decision Control Statements – The decision and case control statements allow selective processing of a statement of a group of statements. These are also called as Conditional Statements. Repetition or Loop Control Statements – The Loop control statement executes a group of statements repeatedly […]
C if, if-else and switch statements
C programming language provides two types of control statements. Selection or Decision Control Statements – The decision and case control statements allow selective processing of a statement of a group of statements. These are also called as Conditional Statements. Repetition or Loop Control Statements – The Loop control statement executes a group of statements repeatedly […]
C Operators and Type Conversion
Operators An operator is a symbol that represents a particular operation that can be performed on some data. The data is called an operand. The operator thus operates on an operand. Operators could be classified as “unary”, “binary” or “ternary” depending on the number of operands i.e, one, two, or three respectively. Unary expression: A […]
Basics of C Preprocessors
The Preprocessor Directive The preprocessor is a program that is invoked by the compiler to process code before compilation. Commands for that program, known as directives, are lines of the source file beginning with the character #, which distinguishes them from lines of source program text. The effect of each preprocessor directive is a change […]
C Constants, Variables and Data Types
C is a structured programming language developed at AT&T’s Bell Laboratories of USA in 1972. It was designed and written by Dennis M. Ritchie. In the late seventies, C began to replace the more familiar languages of that time like PL/1, ALGOL etc. Possibly, C seems so popular because it is reliable, simple, and easy […]
Basics of File Handling in C
Quite often, it becomes necessary to manipulate large amounts of data, which cannot be typed manually through the keyboard. It may also be possible that the output of one program becomes an input to the other. In such cases, the data are simply stored in files. Files are what they mean in normal English – […]
Beginners Guide to C Structures: Definition, creation and manipulation
We have learned to create group elements of the same type into a single logical entity array. If it looks like jargon, consider this, the variables are being put in a group, they are referred by a single name – and importantly they were all of the same types. Either all were integers, all floats, […]
Beginners Guide to C functions
A function is often defined as a section of a program performing a specific job. In fact, the concept of functions (which were originally a subset of a concept called subprograms) came up because of the following argument. Imagine a program wherein a set of operations are to be done often. (Not continuously N times […]