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
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);
}