SlideShare ist ein Scribd-Unternehmen logo
1 von 18
Basics of ‘C’
Programming
Presented By: Shamsul Husain Ansari
G. H. Raisoni Institute of Engineering & Technology, Nagpur
What is ‘C’?
C is a Procedure Oriented Programming language use for Game design,
Graphics, Enterprise Applications.
C is widely used language. It provides many features that are given below.
● Machine Independent
● High Speed
● Pointers
● Recursion
Header Files : Header files in C language Contains the set of predefined standard
library functions.
● #include<stdio.h> : It is used for perform input and output operations using
functions scanf() and printf().
● #include<math.h>: It is used to perform mathematical operations like sqrt(),
pow(), etc.
● #include<time.h>: It is used to perform functions related to date() and time().
● #include<fstream.h>: It is used to control the data to read from a file as an
input and data to write into the file as an output
● Example : #include<stdio.h>
Header files in ‘C’.
What is main in ‘C’.
A main is a predefined keyword or function in C. It is a special function that always starts
executing code from the ‘main’ having ‘int’ or ‘void’ as return data type. In other words, a main()
function is an entry point of the programming code to start its execution.
Syntax:
int main() {
//body of the code
return 0;
}
Basic Structure of C Program
Header file #include<stdio.h>
main function int main() {
Variable declaration int a=20;
Body printf(“The value of a is %d”,a);
return return 0;
}
Keywords & Identifiers in ‘C’
In C language identifiers are the names given to variables, constants, functions and user-
defined data.
Syntax : data_type variable_name;
Examples: int marks; //in Ram the 2 byte of memory allocate by the name of marks.
Keyword Identifier
Int
float
char
number
decimal
character
Data Types in ‘C'
C has various data types to store data in program. C program can store integer,
decimal number, character(alphabets), string(word or sentence), list etc.
Syntax : type variable_name;
Example1: int roll_no; // int used for storing integer value.
Example 2: float percentage; // float data type used for storing decimal
numbers.
Note: C is a case sensitive language. It matter whether an identifier such as variable
name, is UPPERCASE or lowercase.
Keyword Used Format Specifier Size (Bytes)
int “%d” 4
char “%c” 1
float “%f” 4
double “%lf” 8
The format specifiers are used in C for input and output purposes. Using this concept the compiler
can understand that what type of data is in a variable during taking input using scanf() function and
printing using printf() function.
C Input
In C programming, scanf() is one of the commonly used function to take input from the user.
The scanf() function read formatted input from the standard input such as keyboards.
Example:
#include<stdio.h>
int main() {
int age; // variable declaration of type integer.
char name[7];
scanf(“%d”, &age);
scanf(“%s”,name);
printf(“Age= %d”, age); // printf() function used to display the output to
the user.
return 0;
}
Note: & represent the memory address and &age denotes the memory address of age.
Operators in C
An operator is simply a symbol that is used to perform operations. There can be many type of
operations like arithmetic, logical, bitwise, etc.
Arithmetic Operator: An arithmetic operator perform mathematical operation such as addition,
subtraction, multiplication, division etc on numerical values.
Operator Meaning of Operator
+ Addition
- subtraction
* multiplication
/ division
& remainder after division (modulo division)
Example
#include<stdio.h>
int main() {
Int a = 6, b = 4, c;
c = a+b;
printf(“ADDITION: %d”,c);
c = a-b;
printf(“SUBTRACTION: %d”, c);
return 0;
}
Output: ADDITION: 10
SUBTRACTION: 2
Increment & Decrement Operators
C programming has two operator increment ++ and decrement - - to change the
value of an operand (constant or variable) by 1.
Operator Meaning of Operator
++ Increment the value by 1
– – Decrement the value by 1
#include<stdio.h>
int main() {
int a = 10, b = 5;
printf(“INCREMENT: %d”,++a);
printf(“DECREMENT: %d”, - - b );
return 0;
}
Relational Operators
A relational operator checks the relationship between two operands. If the relation
is true, it returns 1; if the relation is false, it return value 0.
Operator Meaning of Operator Example
== Equal to 5 == 3 return 0
> Greater than 5 > 3 return 1
< Less than 5 < 3 return 0
!= Not equal to 5!=3 return 1
>= Greater than or equal to 5>=3 return 1
<= Less than or equal to 5<=3 return 0
Example
#include<stdio.h>
int main() {
Int a = 5, b = 3;
printf(“Equal to: %d”, a==b);
printf(“Not Equal: %d”, a!=b);
return 0;
}
Output: Equal to: 0
Not Equal : 1
Logical Operators
An expression containing logical operator returns either 0 or 1 depending upon
whether expression results true or false. Logical operators are commonly used in
decision making in C Programming
Operator Meaning
&& Logical AND. True only if all the operand
are true.
|| Logical OR. True only if either one operand
is true.
! Logical NOT. Only if the operand is 0
Example
#include<stdio.h>
int main() {
int a = 5, b = 5, c=10, result;
result = (a == b) && (c > b);
printf("%dn", result);
result = (a != b) || (c > b);
printf("%dn", result);
result = !(a == b);
printf("%dn", result);
return 0;
}
Exercise
Char type
Integer type
Float type
Solution

Weitere ähnliche Inhalte

Ähnlich wie Basic of C Programming | 2022 Updated | By Shamsul H. Ansari

Ch2 introduction to c
Ch2 introduction to cCh2 introduction to c
Ch2 introduction to cHattori Sidek
 
c_pro_introduction.pptx
c_pro_introduction.pptxc_pro_introduction.pptx
c_pro_introduction.pptxRohitRaj744272
 
Programming Fundamentals lecture 5
Programming Fundamentals lecture 5Programming Fundamentals lecture 5
Programming Fundamentals lecture 5REHAN IJAZ
 
Introduction to c programming
Introduction to c programmingIntroduction to c programming
Introduction to c programmingAlpana Gupta
 
Datastructure notes
Datastructure notesDatastructure notes
Datastructure notesSrikanth
 
Fundamentals of computer programming by Dr. A. Charan Kumari
Fundamentals of computer programming by Dr. A. Charan KumariFundamentals of computer programming by Dr. A. Charan Kumari
Fundamentals of computer programming by Dr. A. Charan KumariTHE NORTHCAP UNIVERSITY
 
Introduction to C Programming
Introduction to C ProgrammingIntroduction to C Programming
Introduction to C ProgrammingMOHAMAD NOH AHMAD
 
Unit 4 Foc
Unit 4 FocUnit 4 Foc
Unit 4 FocJAYA
 
Introduction to programming c and data structures
Introduction to programming c and data structuresIntroduction to programming c and data structures
Introduction to programming c and data structuresPradipta Mishra
 
Introduction to programming c and data-structures
Introduction to programming c and data-structures Introduction to programming c and data-structures
Introduction to programming c and data-structures Pradipta Mishra
 
C programing Tutorial
C programing TutorialC programing Tutorial
C programing TutorialMahira Banu
 
C_Programming_Language_tutorial__Autosaved_.pptx
C_Programming_Language_tutorial__Autosaved_.pptxC_Programming_Language_tutorial__Autosaved_.pptx
C_Programming_Language_tutorial__Autosaved_.pptxLikhil181
 
presentation_data_types_and_operators_1513499834_241350.pptx
presentation_data_types_and_operators_1513499834_241350.pptxpresentation_data_types_and_operators_1513499834_241350.pptx
presentation_data_types_and_operators_1513499834_241350.pptxKrishanPalSingh39
 
Introduction to C Unit 1
Introduction to C Unit 1Introduction to C Unit 1
Introduction to C Unit 1SURBHI SAROHA
 

Ähnlich wie Basic of C Programming | 2022 Updated | By Shamsul H. Ansari (20)

Ch2 introduction to c
Ch2 introduction to cCh2 introduction to c
Ch2 introduction to c
 
c_pro_introduction.pptx
c_pro_introduction.pptxc_pro_introduction.pptx
c_pro_introduction.pptx
 
Programming Fundamentals lecture 5
Programming Fundamentals lecture 5Programming Fundamentals lecture 5
Programming Fundamentals lecture 5
 
C programming
C programmingC programming
C programming
 
Introduction to c programming
Introduction to c programmingIntroduction to c programming
Introduction to c programming
 
Datastructure notes
Datastructure notesDatastructure notes
Datastructure notes
 
Fundamentals of computer programming by Dr. A. Charan Kumari
Fundamentals of computer programming by Dr. A. Charan KumariFundamentals of computer programming by Dr. A. Charan Kumari
Fundamentals of computer programming by Dr. A. Charan Kumari
 
Introduction to C Programming
Introduction to C ProgrammingIntroduction to C Programming
Introduction to C Programming
 
Unit 4 Foc
Unit 4 FocUnit 4 Foc
Unit 4 Foc
 
Introduction to programming c and data structures
Introduction to programming c and data structuresIntroduction to programming c and data structures
Introduction to programming c and data structures
 
Introduction to programming c and data-structures
Introduction to programming c and data-structures Introduction to programming c and data-structures
Introduction to programming c and data-structures
 
C programming
C programmingC programming
C programming
 
Unit-IV.pptx
Unit-IV.pptxUnit-IV.pptx
Unit-IV.pptx
 
CP Handout#2
CP Handout#2CP Handout#2
CP Handout#2
 
Programming in c
Programming in cProgramming in c
Programming in c
 
C programing Tutorial
C programing TutorialC programing Tutorial
C programing Tutorial
 
C_Programming_Language_tutorial__Autosaved_.pptx
C_Programming_Language_tutorial__Autosaved_.pptxC_Programming_Language_tutorial__Autosaved_.pptx
C_Programming_Language_tutorial__Autosaved_.pptx
 
presentation_data_types_and_operators_1513499834_241350.pptx
presentation_data_types_and_operators_1513499834_241350.pptxpresentation_data_types_and_operators_1513499834_241350.pptx
presentation_data_types_and_operators_1513499834_241350.pptx
 
Introduction to C Unit 1
Introduction to C Unit 1Introduction to C Unit 1
Introduction to C Unit 1
 
C programming
C programmingC programming
C programming
 

Kürzlich hochgeladen

The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxLoriGlavin3
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .Alan Dix
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxLoriGlavin3
 
Training state-of-the-art general text embedding
Training state-of-the-art general text embeddingTraining state-of-the-art general text embedding
Training state-of-the-art general text embeddingZilliz
 
Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rick Flair
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
Sample pptx for embedding into website for demo
Sample pptx for embedding into website for demoSample pptx for embedding into website for demo
Sample pptx for embedding into website for demoHarshalMandlekar2
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxhariprasad279825
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxLoriGlavin3
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 

Kürzlich hochgeladen (20)

The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptx
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
 
Training state-of-the-art general text embedding
Training state-of-the-art general text embeddingTraining state-of-the-art general text embedding
Training state-of-the-art general text embedding
 
Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
Sample pptx for embedding into website for demo
Sample pptx for embedding into website for demoSample pptx for embedding into website for demo
Sample pptx for embedding into website for demo
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptx
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 

Basic of C Programming | 2022 Updated | By Shamsul H. Ansari

  • 1. Basics of ‘C’ Programming Presented By: Shamsul Husain Ansari G. H. Raisoni Institute of Engineering & Technology, Nagpur
  • 2. What is ‘C’? C is a Procedure Oriented Programming language use for Game design, Graphics, Enterprise Applications. C is widely used language. It provides many features that are given below. ● Machine Independent ● High Speed ● Pointers ● Recursion
  • 3. Header Files : Header files in C language Contains the set of predefined standard library functions. ● #include<stdio.h> : It is used for perform input and output operations using functions scanf() and printf(). ● #include<math.h>: It is used to perform mathematical operations like sqrt(), pow(), etc. ● #include<time.h>: It is used to perform functions related to date() and time(). ● #include<fstream.h>: It is used to control the data to read from a file as an input and data to write into the file as an output ● Example : #include<stdio.h> Header files in ‘C’.
  • 4. What is main in ‘C’. A main is a predefined keyword or function in C. It is a special function that always starts executing code from the ‘main’ having ‘int’ or ‘void’ as return data type. In other words, a main() function is an entry point of the programming code to start its execution. Syntax: int main() { //body of the code return 0; }
  • 5. Basic Structure of C Program Header file #include<stdio.h> main function int main() { Variable declaration int a=20; Body printf(“The value of a is %d”,a); return return 0; }
  • 6. Keywords & Identifiers in ‘C’ In C language identifiers are the names given to variables, constants, functions and user- defined data. Syntax : data_type variable_name; Examples: int marks; //in Ram the 2 byte of memory allocate by the name of marks. Keyword Identifier Int float char number decimal character
  • 7. Data Types in ‘C' C has various data types to store data in program. C program can store integer, decimal number, character(alphabets), string(word or sentence), list etc. Syntax : type variable_name; Example1: int roll_no; // int used for storing integer value. Example 2: float percentage; // float data type used for storing decimal numbers. Note: C is a case sensitive language. It matter whether an identifier such as variable name, is UPPERCASE or lowercase.
  • 8. Keyword Used Format Specifier Size (Bytes) int “%d” 4 char “%c” 1 float “%f” 4 double “%lf” 8 The format specifiers are used in C for input and output purposes. Using this concept the compiler can understand that what type of data is in a variable during taking input using scanf() function and printing using printf() function.
  • 9. C Input In C programming, scanf() is one of the commonly used function to take input from the user. The scanf() function read formatted input from the standard input such as keyboards. Example: #include<stdio.h> int main() { int age; // variable declaration of type integer. char name[7]; scanf(“%d”, &age); scanf(“%s”,name); printf(“Age= %d”, age); // printf() function used to display the output to the user. return 0; } Note: & represent the memory address and &age denotes the memory address of age.
  • 10. Operators in C An operator is simply a symbol that is used to perform operations. There can be many type of operations like arithmetic, logical, bitwise, etc. Arithmetic Operator: An arithmetic operator perform mathematical operation such as addition, subtraction, multiplication, division etc on numerical values. Operator Meaning of Operator + Addition - subtraction * multiplication / division & remainder after division (modulo division)
  • 11. Example #include<stdio.h> int main() { Int a = 6, b = 4, c; c = a+b; printf(“ADDITION: %d”,c); c = a-b; printf(“SUBTRACTION: %d”, c); return 0; } Output: ADDITION: 10 SUBTRACTION: 2
  • 12. Increment & Decrement Operators C programming has two operator increment ++ and decrement - - to change the value of an operand (constant or variable) by 1. Operator Meaning of Operator ++ Increment the value by 1 – – Decrement the value by 1 #include<stdio.h> int main() { int a = 10, b = 5; printf(“INCREMENT: %d”,++a); printf(“DECREMENT: %d”, - - b ); return 0; }
  • 13. Relational Operators A relational operator checks the relationship between two operands. If the relation is true, it returns 1; if the relation is false, it return value 0. Operator Meaning of Operator Example == Equal to 5 == 3 return 0 > Greater than 5 > 3 return 1 < Less than 5 < 3 return 0 != Not equal to 5!=3 return 1 >= Greater than or equal to 5>=3 return 1 <= Less than or equal to 5<=3 return 0
  • 14. Example #include<stdio.h> int main() { Int a = 5, b = 3; printf(“Equal to: %d”, a==b); printf(“Not Equal: %d”, a!=b); return 0; } Output: Equal to: 0 Not Equal : 1
  • 15. Logical Operators An expression containing logical operator returns either 0 or 1 depending upon whether expression results true or false. Logical operators are commonly used in decision making in C Programming Operator Meaning && Logical AND. True only if all the operand are true. || Logical OR. True only if either one operand is true. ! Logical NOT. Only if the operand is 0
  • 16. Example #include<stdio.h> int main() { int a = 5, b = 5, c=10, result; result = (a == b) && (c > b); printf("%dn", result); result = (a != b) || (c > b); printf("%dn", result); result = !(a == b); printf("%dn", result); return 0; }