SlideShare ist ein Scribd-Unternehmen logo
1 von 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

Weitere Àhnliche Inhalte

Was ist angesagt?

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
 
Report on c
Report on cReport on c
Report on c
jasmeen kr
 

Was ist angesagt? (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
 

Ähnlich wie 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
 

Ähnlich wie 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
 

KĂŒrzlich hochgeladen

The title is not connected to what is inside
The title is not connected to what is insideThe title is not connected to what is inside
The title is not connected to what is inside
shinachiaurasa2
 
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
masabamasaba
 

KĂŒrzlich hochgeladen (20)

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-...
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
 
Introducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) SolutionIntroducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) Solution
 
The title is not connected to what is inside
The title is not connected to what is insideThe title is not connected to what is inside
The title is not connected to what is inside
 
WSO2CON2024 - It's time to go Platformless
WSO2CON2024 - It's time to go PlatformlessWSO2CON2024 - It's time to go Platformless
WSO2CON2024 - It's time to go Platformless
 
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
 
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
 
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
 
%in Soweto+277-882-255-28 abortion pills for sale in soweto
%in Soweto+277-882-255-28 abortion pills for sale in soweto%in Soweto+277-882-255-28 abortion pills for sale in soweto
%in Soweto+277-882-255-28 abortion pills for sale in soweto
 
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
 
Harnessing ChatGPT - Elevating Productivity in Today's Agile Environment
Harnessing ChatGPT  - Elevating Productivity in Today's Agile EnvironmentHarnessing ChatGPT  - Elevating Productivity in Today's Agile Environment
Harnessing ChatGPT - Elevating Productivity in Today's Agile Environment
 
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
 
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
 
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
 
8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students
 
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 đŸ”âœ”ïžâœ”ïž
 
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
 
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 đŸ”âœ”ïžâœ”ïž
 
Announcing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK SoftwareAnnouncing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK Software
 
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park %in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
 

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