Ce diaporama a bien été signalé.
Le téléchargement de votre SlideShare est en cours. ×

day 3 operatorsd.pptx

Publicité
Publicité
Publicité
Publicité
Publicité
Publicité
Publicité
Publicité
Publicité
Publicité
Publicité
Publicité
Chargement dans…3
×

Consultez-les par la suite

1 sur 12 Publicité

Plus De Contenu Connexe

Similaire à day 3 operatorsd.pptx (20)

Publicité

day 3 operatorsd.pptx

  1. 1. And it’s types
  2. 2. What is an operator? An operator is simply a symbol that is used to perform operations. There can be many types of operations like arithmetic, logical, bitwise, etc. Types of Operator : 1. Arithmetic Operator 2. Relational Operator 3. Logical operator 4. Assignment operator 5. Bitwise operator 6. Ternary/ Conditional operator Shift operator
  3. 3. ARITHMETIC OPERATORS #include<stdio.h> int main() { int A,B,C,D,E,H; float F; printf("Enter the two variable A and b n"); scanf("%d%d",&A,&B); C=A+B; D=A-B; E=A*B; F=A/B; H=A%B; printf(" the Addition = %d ",C); //C=A+B printf(" the Subtraction = %d ",D);// D=A-B printf(" the Multiplication = %d ",E);//E=AB=>A*B printf(" the division = %f ",F);//F=A/B RETURNS QUOTIENT printf(" the remainder = %d",H);// RETURNS REMAINDER return 0; }  ADDITION +  SUBTRACTION -  MUTIPLICATION *  DIVISION /  MODULARTION %
  4. 4. LOGICAL OPERATOR It checks the condition and return the statement . True statement – 1 - true False statement – 0 - false
  5. 5. Sample programs: #include <stdio.h> int main( ) { int a=10,b=8; printf(" the AND && is n",((a==10)&&(b==8))); printf(" the OR || is %dn",((a==10)||(b!=8))); printf(" the NOT ! Is dn",(!(a==10)&&(b==8))); // the condition Is true but we use not operator so give false- 0 return 0; }
  6. 6. RELATIONAL OPERATOR
  7. 7. #include <stdio.h> int main() { int a=10,b=5,c=2; printf(“ Greater than big to small > %d n”,(a>b)); printf(“ Less than small to big < %dn”,(b<a)); printf(“ Greater than equal to >= %dn”,(a>b)); printf(“ Less than equal to >n”,(b<a)); printf(“equal to == %d n”,(c==2)); printf(“Not equal to != %d n”,(c!=2)); return 0; }
  8. 8. ASSIGNMENT OPERATOR

×