SlideShare una empresa de Scribd logo
1 de 12
Introduction To C Programming
PRESENTATION BY AMRINDER PAL SINGH(BCA 1-EVENING)
Operators In C
 There Are Following Types FO]]Of Operators In C Such A:
 Arithmetic Operators
 Relational Operators
 Logical Operators
 Conditional Operators
 Assignment Opertors
 Increment/Decrements Operators
 Bitwise Operators
 Special Operators
Arithmetic Operators
 What Are Arithmetic Operators?
 Arithmetic Operators Are Those Operators Which Are Used To Perform
Arithmetical/Mathematical Operations In C.
 Examples Are:
 +(Plus) Used For Addition
 -(Minus) Used For Subtraction
 *(Multiply) Used For Multiplication
 /(Divide) Used For Division
 %(Modulus) Used For Modulation Or Finding Of remainder
Arithmetic Operators
 Syntax:
#include<stdio.h>
void main()
{int a, b, c; // This Program Is used For Addition process
printf(“Enter Two Numbers:n”);
scanf(“%d,%d”,&a,&b);
c=a+b;
printf(“Answer Is %d”,c);
}
Arithmetic Operators
 Output
Enter Two Numbers:
2, 4
Answer Is 6
Logical Operators
 What Are Logical Operators?
 These Operators Are Used To Test One Or More Conditions(Or To Perform
Logical operations)
 Examples
 “&&” Logical And If both the operands are non-zero, then the condition
becomes true
 “||” Logical OR If any of the two operands is non-zero, then the condition
becomes true.
 ! Logical Not If a condition is true, then Logical NOT operator will make it
false.
Logical Operators
 Syntax
 #include <stdio.h>
void main()
{ int a = 5, b = 20, c ;
if ( a && b )
{ printf("Line 1 - Condition is truen" ); }
if ( a || b )
{ printf("Line 2 - Condition is truen" );
}
Logical Operators
 /* lets change the value of a and b */
a = 0; b = 10;
if ( a && b )
{ printf("Line 3 - Condition is truen" );
} else
{ printf("Line 3 - Condition is not truen" );
} if ( !(a && b) )
{ printf("Line 4 - Condition is truen" ); } }
Logical operators
 Output
Line 1 - Condition is true
Line 2 - Condition is true
Line 3 - Condition is not true
Line 4 - Condition is true
Conditional Operators
 What Are Conditional Operators?
 Conditional Operators Is A Turnary Operators Which Is A Set Off 2 Symbols
Or Operators.
 Examples
 (x>y)?prinft(“%d”,x):(“%d”,y);
Conditional Operators
 Syntax
 #include<stdio.h>
void main()
{ int a, b;
printf(“Enter Two Number:n”);
scanf(“%d”,&a,&b);
(a>b)?printf(“%d Is Greater”,x):printf(“%d Is greater”,y);
}
Conditional Operators
 Output
Enter two numbers:
22, 55
55 Is Greater

Más contenido relacionado

La actualidad más candente

Operators and expressions
Operators and expressionsOperators and expressions
Operators and expressions
vishaljot_kaur
 
Basic c operators
Basic c operatorsBasic c operators
Basic c operators
dishti7
 
CBSE Class XI :- Operators in C++
CBSE Class XI :- Operators in C++CBSE Class XI :- Operators in C++
CBSE Class XI :- Operators in C++
Pranav Ghildiyal
 

La actualidad más candente (20)

Operators and expressions
Operators and expressionsOperators and expressions
Operators and expressions
 
6 operators-in-c
6 operators-in-c6 operators-in-c
6 operators-in-c
 
Operators and expressions in c language
Operators and expressions in c languageOperators and expressions in c language
Operators and expressions in c language
 
Basic c operators
Basic c operatorsBasic c operators
Basic c operators
 
Types of operators in C
Types of operators in CTypes of operators in C
Types of operators in C
 
Basic c operators
Basic c operatorsBasic c operators
Basic c operators
 
Operator of C language
Operator of C languageOperator of C language
Operator of C language
 
CBSE Class XI :- Operators in C++
CBSE Class XI :- Operators in C++CBSE Class XI :- Operators in C++
CBSE Class XI :- Operators in C++
 
C Operators
C OperatorsC Operators
C Operators
 
Operator.ppt
Operator.pptOperator.ppt
Operator.ppt
 
Operator in c programming
Operator in c programmingOperator in c programming
Operator in c programming
 
Operators
OperatorsOperators
Operators
 
C operators
C operatorsC operators
C operators
 
Report on c
Report on cReport on c
Report on c
 
C – operators and expressions
C – operators and expressionsC – operators and expressions
C – operators and expressions
 
Operators and expressions in C++
Operators and expressions in C++Operators and expressions in C++
Operators and expressions in C++
 
Operators in C Programming
Operators in C ProgrammingOperators in C Programming
Operators in C Programming
 
2. operators in c
2. operators in c2. operators in c
2. operators in c
 
Operators in c++
Operators in c++Operators in c++
Operators in c++
 
Expression and Operartor In C Programming
Expression and Operartor In C Programming Expression and Operartor In C Programming
Expression and Operartor In C Programming
 

Similar a ppt on logical/arthimatical/conditional operators

PROGRAMMING IN C - Operators.pptx
PROGRAMMING IN C - Operators.pptxPROGRAMMING IN C - Operators.pptx
PROGRAMMING IN C - Operators.pptx
Nithya K
 
C programming session 02
C programming session 02C programming session 02
C programming session 02
Dushmanta Nath
 
3 operators-expressions-and-statements-120712073351-phpapp01
3 operators-expressions-and-statements-120712073351-phpapp013 operators-expressions-and-statements-120712073351-phpapp01
3 operators-expressions-and-statements-120712073351-phpapp01
Abdul Samee
 
3 operators-expressions-and-statements-120712073351-phpapp01
3 operators-expressions-and-statements-120712073351-phpapp013 operators-expressions-and-statements-120712073351-phpapp01
3 operators-expressions-and-statements-120712073351-phpapp01
Abdul Samee
 

Similar a ppt on logical/arthimatical/conditional operators (20)

Theory3
Theory3Theory3
Theory3
 
Expressions using operator in c
Expressions using operator in cExpressions using operator in c
Expressions using operator in c
 
PROGRAMMING IN C - Operators.pptx
PROGRAMMING IN C - Operators.pptxPROGRAMMING IN C - Operators.pptx
PROGRAMMING IN C - Operators.pptx
 
Operators in C Programming
Operators in C ProgrammingOperators in C Programming
Operators in C Programming
 
Programming Fundamentals lecture 7
Programming Fundamentals lecture 7Programming Fundamentals lecture 7
Programming Fundamentals lecture 7
 
C Operators and Control Structures.pdf
C Operators and Control Structures.pdfC Operators and Control Structures.pdf
C Operators and Control Structures.pdf
 
COM1407: C Operators
COM1407: C OperatorsCOM1407: C Operators
COM1407: C Operators
 
C Operators and Control Structures.pptx
C Operators and Control Structures.pptxC Operators and Control Structures.pptx
C Operators and Control Structures.pptx
 
Operators in c by anupam
Operators in c by anupamOperators in c by anupam
Operators in c by anupam
 
C programming session 02
C programming session 02C programming session 02
C programming session 02
 
Operators-computer programming and utilzation
Operators-computer programming and utilzationOperators-computer programming and utilzation
Operators-computer programming and utilzation
 
Few Operator used in c++
Few Operator used in c++Few Operator used in c++
Few Operator used in c++
 
2 EPT 162 Lecture 2
2 EPT 162 Lecture 22 EPT 162 Lecture 2
2 EPT 162 Lecture 2
 
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
 
ICP - Lecture 5
ICP - Lecture 5ICP - Lecture 5
ICP - Lecture 5
 
Programming C Part 02
Programming C Part 02Programming C Part 02
Programming C Part 02
 
03. operators and-expressions
03. operators and-expressions03. operators and-expressions
03. operators and-expressions
 
3 operators-expressions-and-statements-120712073351-phpapp01
3 operators-expressions-and-statements-120712073351-phpapp013 operators-expressions-and-statements-120712073351-phpapp01
3 operators-expressions-and-statements-120712073351-phpapp01
 
3 operators-expressions-and-statements-120712073351-phpapp01
3 operators-expressions-and-statements-120712073351-phpapp013 operators-expressions-and-statements-120712073351-phpapp01
3 operators-expressions-and-statements-120712073351-phpapp01
 
answer-model-qp-15-pcd13pcd
answer-model-qp-15-pcd13pcdanswer-model-qp-15-pcd13pcd
answer-model-qp-15-pcd13pcd
 

Último

introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdfintroduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
VishalKumarJha10
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
mohitmore19
 

Último (20)

introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdfintroduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
 
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
Direct Style Effect Systems -The Print[A] Example- A Comprehension AidDirect Style Effect Systems -The Print[A] Example- A Comprehension Aid
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTV
 
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS LiveVip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
 
Azure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdf
Azure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdfAzure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdf
Azure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdf
 
Microsoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdfMicrosoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdf
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
 
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with Precision
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
 
How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.js
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Models
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
 
How to Choose the Right Laravel Development Partner in New York City_compress...
How to Choose the Right Laravel Development Partner in New York City_compress...How to Choose the Right Laravel Development Partner in New York City_compress...
How to Choose the Right Laravel Development Partner in New York City_compress...
 
Exploring the Best Video Editing App.pdf
Exploring the Best Video Editing App.pdfExploring the Best Video Editing App.pdf
Exploring the Best Video Editing App.pdf
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf
 
The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...
The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...
The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...
 

ppt on logical/arthimatical/conditional operators

  • 1. Introduction To C Programming PRESENTATION BY AMRINDER PAL SINGH(BCA 1-EVENING)
  • 2. Operators In C  There Are Following Types FO]]Of Operators In C Such A:  Arithmetic Operators  Relational Operators  Logical Operators  Conditional Operators  Assignment Opertors  Increment/Decrements Operators  Bitwise Operators  Special Operators
  • 3. Arithmetic Operators  What Are Arithmetic Operators?  Arithmetic Operators Are Those Operators Which Are Used To Perform Arithmetical/Mathematical Operations In C.  Examples Are:  +(Plus) Used For Addition  -(Minus) Used For Subtraction  *(Multiply) Used For Multiplication  /(Divide) Used For Division  %(Modulus) Used For Modulation Or Finding Of remainder
  • 4. Arithmetic Operators  Syntax: #include<stdio.h> void main() {int a, b, c; // This Program Is used For Addition process printf(“Enter Two Numbers:n”); scanf(“%d,%d”,&a,&b); c=a+b; printf(“Answer Is %d”,c); }
  • 5. Arithmetic Operators  Output Enter Two Numbers: 2, 4 Answer Is 6
  • 6. Logical Operators  What Are Logical Operators?  These Operators Are Used To Test One Or More Conditions(Or To Perform Logical operations)  Examples  “&&” Logical And If both the operands are non-zero, then the condition becomes true  “||” Logical OR If any of the two operands is non-zero, then the condition becomes true.  ! Logical Not If a condition is true, then Logical NOT operator will make it false.
  • 7. Logical Operators  Syntax  #include <stdio.h> void main() { int a = 5, b = 20, c ; if ( a && b ) { printf("Line 1 - Condition is truen" ); } if ( a || b ) { printf("Line 2 - Condition is truen" ); }
  • 8. Logical Operators  /* lets change the value of a and b */ a = 0; b = 10; if ( a && b ) { printf("Line 3 - Condition is truen" ); } else { printf("Line 3 - Condition is not truen" ); } if ( !(a && b) ) { printf("Line 4 - Condition is truen" ); } }
  • 9. Logical operators  Output Line 1 - Condition is true Line 2 - Condition is true Line 3 - Condition is not true Line 4 - Condition is true
  • 10. Conditional Operators  What Are Conditional Operators?  Conditional Operators Is A Turnary Operators Which Is A Set Off 2 Symbols Or Operators.  Examples  (x>y)?prinft(“%d”,x):(“%d”,y);
  • 11. Conditional Operators  Syntax  #include<stdio.h> void main() { int a, b; printf(“Enter Two Number:n”); scanf(“%d”,&a,&b); (a>b)?printf(“%d Is Greater”,x):printf(“%d Is greater”,y); }
  • 12. Conditional Operators  Output Enter two numbers: 22, 55 55 Is Greater