C Language

Ternary Operators in C

The ? (ternary condition) operator is a more efficient form for expressing simple if statements. It has the following form:   expression1 ? expression2: expression3 It simply states: if expression1...

Order of Precedence in C

It is necessary to be careful of the meaning of such expressions as  a + b * c We may want the effect as either (a + b) *...

Global Variables in C

Global variables are defined above main() in the following way:-           short number,sum; int bignumber,bigsum; char letter;   main() {   } It is also possible to pre-initialise global variables...

C Program Structure

A C program basically has the following form: Preprocessor Commands Type definitions Function prototypes — declare function types and variables passed to function. Variables Functions We must have a...

Characteristics of C

We briefly list some of C’s characteristics that define the language and also have lead to its popularity as a programming language. Naturally we will be studying many of...

If Else Statements

The if, if…else and nested if…else statement are used to make one-time decisions in C Programming, that is, to execute some code/s and ignore some code/s depending upon the...

Operators in C

Operators are the symbol which operates on value or a variable. For example: + is a operator to perform addition. C programming language has wide range of operators to...

Input/Output in C

ANSI standard has defined many library functions for input and output in C language. Functions printf() and scanf() are the most commonly used to display out and take input...

Datatypes in C

In C, variable(data) should be declared before it can be used in program. Data types are the keywords, which are used for assigning a type to a variable. Data...

Variables and Constants

Variables Variables are memory location in computer’s memory to store data. To indicate the memory location, each variable should be given a unique name called identifier. Variable names are...