100% found this document useful (1 vote)
12 views

C Presentation

The document provides an overview of the C programming language, detailing its history, features, keywords, data types, operators, control statements, and variable types. It highlights the flexibility and versatility of C, along with its syntax rules and the use of preprocessor directives. Additionally, it explains various control structures such as loops and conditional statements used in C programming.

Uploaded by

maheshwarbade358
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF or read online on Scribd
100% found this document useful (1 vote)
12 views

C Presentation

The document provides an overview of the C programming language, detailing its history, features, keywords, data types, operators, control statements, and variable types. It highlights the flexibility and versatility of C, along with its syntax rules and the use of preprocessor directives. Additionally, it explains various control structures such as loops and conditional statements used in C programming.

Uploaded by

maheshwarbade358
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF or read online on Scribd
You are on page 1/ 64
HISTORY OF C NS * Dennis Ritchie, the founder of C programming Language Developed C in the year 1972 at Bell Laboratories (U.S.A). * C was originally first implemented on the DEC PDP-11 computer. * C is very flexible and versatile, allowing maximum control with minimal commands. FEATURES OF C LANGUAGE ‘“ as . J------ ° ease Stra eRe = NWF) Lol ~~ ~~ ji teers Extensible Google (tate te nico 10 Download Turbo C++ for Windows 7, 8, 8.1 and Windows 10 (32-6 Turbo C run on Windows 107 Jo | download Turbo C on Windows? is Turbo c nd Cre same? ‘an Turbo G++ run C program? Turbo C++ oF C for Windows 7, 8, 8.1 and 10 32/64-bit Full Screen ripsvarchvecodepiex com psturbor st © they ine-C ep @ Related Keywords Keyword mo so 8 > [Fo ison Free 0 Browser Addon @ People Also Search For C TOKENS ES es es == eeu Se = KEYWORDS eens Keywords are defined those variables which have special meaning and are predefined in the C Libraries. Example: For, if, else, main, etc KEYWORDS auto default break case char const double else ae for int long register return short _—_ signed struct | switch typedef union —_ unsigned _—_void EE] =e continue do goto i sizeof static volatile | while wvnedure CONSTANTS Geta Constants or Literals are like variables, but the difference is that, the values of the constants are fixed. Once declared, they can not be changed. syntax: const data_type variable_name; (or) const data_type *variable_name; cD cy EDUREKA CERTIFICATION TRAINING wwe STRINGS ™ Strings are defined as a collection of characters defined in form of an array and end with null character which describe the end of the string to the compiler. Syntax: char string_name[Length_of_the_string] Feces | [Se SPECIAL SYMBOLS = Special characters are symbols (single characters or sequences of characters) that have a "special" built-in meaning in the language and typically cannot be used in identifiers. Example: 1%, &, () t} E= I =e woven IDENTIFIERS Identifiers are defined as the names that we declare in a program in order to name a value, variable, function, array and etc. Example: int x: CDS cy EDUREKA CERTIFICATION TRAINING wwwned RULES FOR IDENTIFIERS ™ 1, First character should be an alphabet or underscore. 2. Succeeding characters can be digits or letter. 3. Special characters are not allowed except underscore. 4. Identifiers should not be keywords. & Valid Identifiers names: Invalid Identifiers names: hoy int a; it 2; ¢ int _ab; int ab; - int 230; it long; Ee] a wn OPERATORS ™ + Athematic Operators + Increment / Decrement Operators })_ + Assignment Operators + Relational Operators + Logical Operators + Bitwise Operators =] Sa ETT woud ARITHMATIC OPERATORS ™ Arithmetic Operators are used to perform Mathematical Calculations such as Addition, Subtraction, Multiplication, Division, and Modulus. Ee] ee wn INCREMENT/DECREMENT OPERATORS ™% Increment Operator is used to increase the value of a variable by a specific number and Decrement Operators are used to decrease the value of a variable by a specific number. Example: i++; //Increment i-- ; //Decrement itt i-- Ee ASSIGNMENT OPERATORS = Assignment Operators are used to assign the values for the variables in C Programming Language. Examples for assignment operators are as follows: int a=10; cies weno nas owe RELATIONAL OPERATORS Relational Operator is a programming language construct or operator that tests or defines relation between two entities/ variables. Examples for Relational operators are as follows: ><, 5,15 If(a= Hinclude "filename" Ee] a = #DEFINE The #define preprocessor directive is used to define constant or micro y substitution. It can use any basic data type. Syntax: itdefine token value f EE] Ee a #UNDEF * The #undef preprocessor directive is used to undefine the constant or macro >» defined by tidefine, Syntax: Eel ee wos #IFDEF “ The #ifdef preprocessor directive checks if macro is defined by #tdefine. If yes, it executes the code otherwise flelse code is executed, if present. Ps Syntax; ifdef MACRO //code segment itendif Sane FER enced #IFNDEF q The #ifndef preprocessor directive checks if macro is not defined by #idefine. If yes, it executes the code otherwise #else code is executed, if present. - Syntax: ifndef MACRO Heode Hendif EI cnc ae wos #ELSE The #lelse preprocessor directive evaluates the expression or condition if condition of if is false. It can be used with #if, Helif, ifdef and #ifndef directives. » Syntax: if expression Jif code Helse Helse code Hendif EDUREKA CERTIFICATION TRAINING wvredure #ERROR The error preprocessor directive » indicates error. The compiler gives fatal error if #error directive is found and skips further compilation process. EDUREKA CERTIFICATION TRAINING vnedure #PRAGMA The #pragma preprocessor directive is used to provide additional information to the compiler. The pragma directive is used by the compiler to offer machine or operating-system feature. Syntax: Hpragma token EI cs cee ae oc aan Pstrstraeoc ted int main() : a (GrseCl esti Fr ery CONTROL STATEMENTS Control statements enable us to specify the flow of program control. They specify the order in which the instructions in a program must be executed. They make it possible to make decisions, to perform tasks repeatedly or to jump from one section of code to another. There are the following variants of if statement in C language. * Ifstatement * if-else statement + Ifelse-if ladder + Nested if + Switch + Ternary + Break ST so IF CONTROL STATEMENT if statement in C Language is defined as a programming conditional statement that, if proved true, performs an operation or displays information inside the statement block. 4] Sree — IF CONTROL STATEMENT False aoa =a a IF-ELSE CONTROL STATEMENT * If-else statement in C Language is defined as a programming conditional statement that has two Statement blocks over a condition. if proved true, then the if block will be executed and if false, then the else block will be executed. EDUREKA CERTIFICATION TRAINING wwnedure IF-ELSE CONTROL STATEMENT “ E= | TT oc IF ELSE LADDER CONTROL STATEMENT < It-else ladder in C Language is defined as a programming conditional statement that has multiple else-if statement blocks. If any of the condition is. true, then the control will exit the else-if ladder and execute the next set of statements. EDUREKA CERTIFICATION TRAINING wvnedure IF ELSE LADDER CONTROL STATEMENT “ EE RRR wc C Programming For Beginners |. Learn. Programming |.C Tutorial For. Beginners |, Edureka EC r c Nested if statement in C Language is defined as a programming conditional statement that comprises of another if statement inside the previous if statement. [| en aed NESTED IF CONTROL STATEMENT * EZ] SS wos SWITCH CONTROL STATEMENT < switch case in C Language is defined as a programming selection statement that checks for a possible match to the provided condition against the available cases. If none of the cases match, then the control will execute the default statement block. SWITCH CONTROL STATEMENT ’ _— o-= T= Ea TTT oe TERNARY CONTROL STATEMENT * ternary operator in C Language is defined as a programming conditional statement that is similar to an if statement, but shorter in code length. The control checks the condition and executes either of the two statements. = ——)— = ‘edurekal F ecurtat | ATT wo TERNARY CONTROL STATEMENT . EZ] a wo BREAK CONTROL STATEMENT * break statement in C Language is defined as a programming conditional statement that is designed to exit the control from the current code segment to the next code segment when a specific condition is satisfied. SEE wes BREAK CONTROL STATEME im | edureka! LOOPS Loop control statements in C are used to perform looping operations until the given condition is true. Control comes out of the loop statements once condition becomes false. There are three types of loops in C language that is given below: + do while * while * for edurek: EDUREKA CERTIFICATION TRAINING wwredure FOR LOOP * For Loop can defined a precise loop which has Initialization, Condition, and Increment or Decrement. Teel eel} Condition Increment or Decre EJ cin cancion wvnedure FOR LOOP EDUREKA CERTIFICATION TRAINING NESTED FOR LOOP = cas EZ] = WHILE LOOP While Loop can defined a loop which executes itself repeatedly, until a given Boolean expression or a condition is true, F ecurtat | ee wos WHILE LOOP EDUREKA CERTIFICATION TRAINING DO-WHILE LOOP Do While Loop is completely similar to the While Loop. The only difference that pops up is the condition statement. DO-WHILE LOOP ere Condition edureka! False END EZ] —— wo INFINITE LOOP Infinite Loop is situation where the condition of the loop fails and the execution persists until you stop it manually. wvnedure

You might also like