LOOPS IN C

types-of-loop-in-c

In a program until a particular condition is being satisfied, repetition of any operation is called looping. There are two types of loop in C programming. Top tested Bottom Tested  Top Tested :- The loop in which condition is checked before the execution of statement block. Bottom Tested :- The loop in which a single or a block of statements are executed at least once, and then the condition is evaluated. In ‘C’ there are three types of loop:  While loop  Do while loop  For loop ( 1 ) While…

Read More

CONTROL STRUCTURES IN C

Control Structures specifies one or more conditions to be evaluated or tested by the program, along with a statement or statements to be executed if the condition is  true and optionally, other statements to be executed if the condition is false. See blow image to  understand control (Decision making ) structure:- C programming language assumes any zero and null values as false, and if it is either non-zero or non-null, then it is assumed as true value. C programming language provides the following types of decision making statements. If Statement OR If-else…

Read More

Operators in C

operators-in-c-programming

An operator  tells the compiler to perform specific mathematical or logical functions. It is a symbol which is used to perform different task. C language is rich in built-in operators and provides the following types of operators − Assignment Operator ( = ) Mathematical ( Arithmetic ) Operator ( +,-,*,%,/) Unary Increment Operators ( ++, –) Relational Operators ( ==, !=, >, <,>=,<=) Logical Operators ( !, &&, || ) Bitwise Operators ( ~, &, |, ^, >>, << ) Assignment Operators : The assignment operator is the single equals sign (…

Read More

Constants in C

Constants values are those values which can’t alter or change during program execution. These fixed (constants) value are also known as literals. Constants can be any data types like an integer constant, a floating constant, a character constant, or string literal. Integer literal: An integer literal is a sequence of digits and denotes a number. An integer literal is either signed or unsigned. The sign of a literal determines how C– decides whether it stats into its type: A literal starting with “0x” or “0X” is in hexadecimal notation (base…

Read More

Comments and Variables in C

comment-variable-in-c

Comments: ‘C’ supports the standard ‘C’ comment conventions. A one-line comment start with //; the comment includes all characters up to, but not including, the next new line character. A multi-line comment starts with ‘/*’ and ends with ‘*/’. Multi-line comments do not nest; a multi-line comment ends at the ?rst ‘*/’ after the opening ‘/*’. It is a checked compile-time error when an opened comment is not closed in a compilation unit. Comments are not recognized inside string and character literals. /* This is a multi-line comment */ //*/…

Read More

Data Types in C

data-typas-in-c

INTEGER TYPES IN C C supports different kinds of integers maxima and minima defined in “limit.h” limits.h This is the second standard header file we have met. This contains the difinition of a number of constants giving the maximum and minimum sizes of the various kinds of integers. It is a text file and may be viewed with any text editor. Constants: Constants have many types in C. Numbers containing “.” or “e” are double: 3.5, 1e-7, -1.29e15. For float constants append “F”: 3.5F, 1e-7F. For long double constants append…

Read More

THE FORMAT OF C

Format of C

Statements are terminated with semicolons Indentation is ignored by the compiler C is case sensitive – all Keywords and Standard Library functions are in lowercase Strings are placed in double quotes Newlines are handled via \n. Programs are capable of flagging success or error, those forgetting to do so have one or other chosen randomly! Semicolons: Semicolons are very important in C. They from a statement terminator – they tell the compiler where one statement ends and the next one begins. If you fail to place one after each statement,…

Read More

History of C Programming Language

history-of-c-programming

HISTORY OF C C was invented primarily by Brain Kernighan and Dennis Ritchie working at AT&T Bell Labs in the United States. In 1983 the American National Standards Institute began the Standardisation process. In 1989 the International Standards Organization continued the standardisation process. In 1990 a standard was finalized, known simply as “Standard C”. Everything Before this known as “K&R C”. Standardisation : C turned out to be very popular and by the early 1980s hundreds of implementations were begin used by a rapidly growing community of programmers. It was…

Read More