SlideShare a Scribd company logo
1 of 25
EXPRESSIONS AND OPERATORS CHAPTER 3 DTI 2143 1
CONTENTS Arithmetic Operators Assigning Mathematical Operator Combinations Unary Sign Operators Increments And Decrement Operator Conditional Operator Logical Expressions Logical Operator 2 2 CHAPTER 4
INTRODUCTION In any programming languages, we need operators to construct statements to do an operation and calculations. In this chapter, you will be introduced to several operators such as: Unary Operators Binary Operators Ternary Operators Operator can be applied to variables or any elements in an expression to produce some kind of computation or action. 3
ARITHMETIC OPERATORS We can form more complicated arithmetic expressions by using arithmetic operators. There are two types of arithmetic operators in c such as: Unary arithmetic operators ,[object Object],Binary arithmetic operators ,[object Object],4
Examples of Unary arithmetic operators Binary arithmetic operators 5
Example 1 #include <stdio.h> #include <conio.h> int main(void) { int num= 20; int val=30; num=val+5; 	/* num=30+5*/ val=num-val;	 /*val=35-30*/ num=num+2;	 /*num=35-5*/ val=30/7;		/*val=30/7*/ getch(); return 0; } 6
Example 2 #include <stdio.h> #include <conio.h> int main(void) { int num= 20; printf (“%d”, num); int val=30; printf (“%d”, val); num=val+5;  printf (“%d”, num); val=num-val; printf (“%d”, val); num=num+2;	 printf (“%d”, num); val=30/7; printf (“%d”, val); getch(); return 0; } 7
Example 3 #include <stdio.h> #include <conio.h> int main(void) { int a,b,c,d,result; a=10; b=20; c=15; d=8; result=a*b/(-c*31%13)*d; printf ("%d",result); getch(); return 0; } 8
How to Solves Example 3? ,[object Object],    a=10,b=20,c=15,d=8,e=40, 	a  * b  / (-c  *  31  %  13   )*  d     9
Example 3 #include <stdio.h> #include <conio.h> int main(void) { int num =5; num -=3; num +=4; printf ("%d", num); getch(); return 0; } 10
Example 4 total = total / 2; bonus=bonus+800; balance =balance- sum + tax 11
INCREMENTS AND DECREMENT OPERATOR ,[object Object]
The operators are:Unary Increment operators		:		++ ++i  (prefix) i++   (postfix) Unary Decrement Operators	:		 -- --i  (prefix) i--   (postfix) 12
Unary Increment operators		:		++ ,[object Object]
Also used as counter in loop structure
Eg:i=i+1; or
i +=1;Unary Decrement Operators	:		 -- ,[object Object]
Eg:i=i-1 or
i -=1; 13
INCREMENTS OPERATOR /*Output : 1*/ /*Output : 1*/ 14
LOGICAL EXPRESSIONS ,[object Object],15
RELATIONAL AND EQUALITY OPERATOR 16
Example 1 a	=	  6; b	=	  1; c	=	- 2; 1 1 0 0 17
LOGICAL OPERATOR ,[object Object],18
EXAMPLE 1 0(FALSE) 1(TRUE) 0(FALSE) 19

More Related Content

What's hot

Operators and expressions
Operators and expressionsOperators and expressions
Operators and expressionsvishaljot_kaur
 
C operators
C operatorsC operators
C operatorsGPERI
 
C OPERATOR
C OPERATORC OPERATOR
C OPERATORrricky98
 
2. operators in c
2. operators in c2. operators in c
2. operators in camar kakde
 
Operators in C Programming
Operators in C ProgrammingOperators in C Programming
Operators in C Programmingprogramming9
 
Functions & Procedures [7]
Functions & Procedures [7]Functions & Procedures [7]
Functions & Procedures [7]ecko_disasterz
 
Operator in c programming
Operator in c programmingOperator in c programming
Operator in c programmingManoj Tyagi
 
Operators in c language
Operators in c languageOperators in c language
Operators in c languageAmit Singh
 
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
 
Operation and expression in c++
Operation and expression in c++Operation and expression in c++
Operation and expression in c++Online
 
C programming Lab 1
C programming Lab 1C programming Lab 1
C programming Lab 1Zaibi Gondal
 
Types of operators in C
Types of operators in CTypes of operators in C
Types of operators in CPrabhu Govind
 
Chapter 5 - Operators in C++
Chapter 5 - Operators in C++Chapter 5 - Operators in C++
Chapter 5 - Operators in C++Deepak Singh
 
Operators and expressions in c language
Operators and expressions in c languageOperators and expressions in c language
Operators and expressions in c languagetanmaymodi4
 
operators and expressions in c++
 operators and expressions in c++ operators and expressions in c++
operators and expressions in c++sanya6900
 

What's hot (20)

Operators in C & C++ Language
Operators in C & C++ LanguageOperators in C & C++ Language
Operators in C & C++ Language
 
Operators and expressions
Operators and expressionsOperators and expressions
Operators and expressions
 
C operators
C operatorsC operators
C operators
 
C OPERATOR
C OPERATORC OPERATOR
C OPERATOR
 
2. operators in c
2. operators in c2. operators in c
2. operators in c
 
Operators in C Programming
Operators in C ProgrammingOperators in C Programming
Operators in C Programming
 
Functions & Procedures [7]
Functions & Procedures [7]Functions & Procedures [7]
Functions & Procedures [7]
 
Prefix Postfix
Prefix PostfixPrefix Postfix
Prefix Postfix
 
Operator in c programming
Operator in c programmingOperator in c programming
Operator in c programming
 
Coper in C
Coper in CCoper in C
Coper in C
 
C – operators and expressions
C – operators and expressionsC – operators and expressions
C – operators and expressions
 
Operators in c language
Operators in c languageOperators in c language
Operators in 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++
 
Operation and expression in c++
Operation and expression in c++Operation and expression in c++
Operation and expression in c++
 
C programming Lab 1
C programming Lab 1C programming Lab 1
C programming Lab 1
 
Types of operators in C
Types of operators in CTypes of operators in C
Types of operators in C
 
Chapter 5 - Operators in C++
Chapter 5 - Operators in C++Chapter 5 - Operators in C++
Chapter 5 - Operators in C++
 
Arithmetic operator
Arithmetic operatorArithmetic operator
Arithmetic operator
 
Operators and expressions in c language
Operators and expressions in c languageOperators and expressions in c language
Operators and expressions in c language
 
operators and expressions in c++
 operators and expressions in c++ operators and expressions in c++
operators and expressions in c++
 

Viewers also liked

โครงงานครั้งที่ 2 (Guava Cake)
โครงงานครั้งที่ 2 (Guava Cake)โครงงานครั้งที่ 2 (Guava Cake)
โครงงานครั้งที่ 2 (Guava Cake)NattAA
 
Super moodlers
Super moodlersSuper moodlers
Super moodlersjohnw3600
 
Alma media cmd 2013 kai telanne
Alma media cmd 2013 kai telanneAlma media cmd 2013 kai telanne
Alma media cmd 2013 kai telanneRauno Heinonen
 
Cuestions de encimas_e_acidos_nucleicos new
Cuestions de encimas_e_acidos_nucleicos newCuestions de encimas_e_acidos_nucleicos new
Cuestions de encimas_e_acidos_nucleicos newjuanapardo
 
Mutacions 2010 2011 new
Mutacions 2010 2011 newMutacions 2010 2011 new
Mutacions 2010 2011 newjuanapardo
 
London Play Framework Meetup 8 August 2013
London Play Framework Meetup 8 August 2013London Play Framework Meetup 8 August 2013
London Play Framework Meetup 8 August 2013Mark Baker
 
Bti1022 lab sheet 8
Bti1022 lab sheet 8Bti1022 lab sheet 8
Bti1022 lab sheet 8alish sha
 
Rèdais & IED_Piovano
Rèdais & IED_PiovanoRèdais & IED_Piovano
Rèdais & IED_PiovanoRèdais
 
Maxim_Mozgovoy_Lamoda_cmf2013
Maxim_Mozgovoy_Lamoda_cmf2013Maxim_Mozgovoy_Lamoda_cmf2013
Maxim_Mozgovoy_Lamoda_cmf2013Evgeny Vasyuk
 
Nha Tran Brand Brief
Nha Tran Brand BriefNha Tran Brand Brief
Nha Tran Brand BriefErnest Chan
 
Rèdais & IED_Pericoli
Rèdais & IED_PericoliRèdais & IED_Pericoli
Rèdais & IED_PericoliRèdais
 
Global economy in reverse gear
Global economy in reverse gearGlobal economy in reverse gear
Global economy in reverse gearSandesh Pawar
 
Recruitment Services For Financial Services
Recruitment Services For Financial ServicesRecruitment Services For Financial Services
Recruitment Services For Financial Servicescrescitasolutions
 
Rèdais & IED_Ozturk
Rèdais & IED_OzturkRèdais & IED_Ozturk
Rèdais & IED_OzturkRèdais
 
How to turn Facebook 'likes' into leads and customers on auto-pilot.
How to turn Facebook 'likes' into leads and customers on auto-pilot.How to turn Facebook 'likes' into leads and customers on auto-pilot.
How to turn Facebook 'likes' into leads and customers on auto-pilot.Julia Bramble
 
Building Google Authorship Authority
Building Google Authorship AuthorityBuilding Google Authorship Authority
Building Google Authorship AuthorityMarvin Libron
 
How to Upload a List From Excel to InfusionSoft
How to Upload a List From Excel to InfusionSoftHow to Upload a List From Excel to InfusionSoft
How to Upload a List From Excel to InfusionSoftMarvin Libron
 

Viewers also liked (20)

โครงงานครั้งที่ 2 (Guava Cake)
โครงงานครั้งที่ 2 (Guava Cake)โครงงานครั้งที่ 2 (Guava Cake)
โครงงานครั้งที่ 2 (Guava Cake)
 
Super moodlers
Super moodlersSuper moodlers
Super moodlers
 
Old batery
Old bateryOld batery
Old batery
 
Alma media cmd 2013 kai telanne
Alma media cmd 2013 kai telanneAlma media cmd 2013 kai telanne
Alma media cmd 2013 kai telanne
 
Cuestions de encimas_e_acidos_nucleicos new
Cuestions de encimas_e_acidos_nucleicos newCuestions de encimas_e_acidos_nucleicos new
Cuestions de encimas_e_acidos_nucleicos new
 
Mutacions 2010 2011 new
Mutacions 2010 2011 newMutacions 2010 2011 new
Mutacions 2010 2011 new
 
ОГЭ - 2015
ОГЭ - 2015ОГЭ - 2015
ОГЭ - 2015
 
London Play Framework Meetup 8 August 2013
London Play Framework Meetup 8 August 2013London Play Framework Meetup 8 August 2013
London Play Framework Meetup 8 August 2013
 
Bti1022 lab sheet 8
Bti1022 lab sheet 8Bti1022 lab sheet 8
Bti1022 lab sheet 8
 
Rèdais & IED_Piovano
Rèdais & IED_PiovanoRèdais & IED_Piovano
Rèdais & IED_Piovano
 
Maxim_Mozgovoy_Lamoda_cmf2013
Maxim_Mozgovoy_Lamoda_cmf2013Maxim_Mozgovoy_Lamoda_cmf2013
Maxim_Mozgovoy_Lamoda_cmf2013
 
Nha Tran Brand Brief
Nha Tran Brand BriefNha Tran Brand Brief
Nha Tran Brand Brief
 
Rèdais & IED_Pericoli
Rèdais & IED_PericoliRèdais & IED_Pericoli
Rèdais & IED_Pericoli
 
Global economy in reverse gear
Global economy in reverse gearGlobal economy in reverse gear
Global economy in reverse gear
 
Recruitment Services For Financial Services
Recruitment Services For Financial ServicesRecruitment Services For Financial Services
Recruitment Services For Financial Services
 
Rèdais & IED_Ozturk
Rèdais & IED_OzturkRèdais & IED_Ozturk
Rèdais & IED_Ozturk
 
How to turn Facebook 'likes' into leads and customers on auto-pilot.
How to turn Facebook 'likes' into leads and customers on auto-pilot.How to turn Facebook 'likes' into leads and customers on auto-pilot.
How to turn Facebook 'likes' into leads and customers on auto-pilot.
 
Lab sheet 1
Lab sheet 1Lab sheet 1
Lab sheet 1
 
Building Google Authorship Authority
Building Google Authorship AuthorityBuilding Google Authorship Authority
Building Google Authorship Authority
 
How to Upload a List From Excel to InfusionSoft
How to Upload a List From Excel to InfusionSoftHow to Upload a List From Excel to InfusionSoft
How to Upload a List From Excel to InfusionSoft
 

Similar to Chapter 3 dti2143

OPERATORS IN C.pptx
OPERATORS IN C.pptxOPERATORS IN C.pptx
OPERATORS IN C.pptxAshokJ19
 
Cse lecture-4.1-c operators and expression
Cse lecture-4.1-c operators and expressionCse lecture-4.1-c operators and expression
Cse lecture-4.1-c operators and expressionFarshidKhan
 
03 Operators and expressions
03 Operators and expressions03 Operators and expressions
03 Operators and expressionsmaznabili
 
Few Operator used in c++
Few Operator used in c++Few Operator used in c++
Few Operator used in c++sunny khan
 
Operators and Expressions in C++
Operators and Expressions in C++Operators and Expressions in C++
Operators and Expressions in C++Praveen M Jigajinni
 
programing in c PPT Gaurav Nautiyal.pptx
programing in c PPT Gaurav Nautiyal.pptxprograming in c PPT Gaurav Nautiyal.pptx
programing in c PPT Gaurav Nautiyal.pptxHacker301428
 
C programming session 02
C programming session 02C programming session 02
C programming session 02Dushmanta Nath
 
Operators expressions-and-statements
Operators expressions-and-statementsOperators expressions-and-statements
Operators expressions-and-statementsCtOlaf
 
ppt on logical/arthimatical/conditional operators
ppt on logical/arthimatical/conditional operatorsppt on logical/arthimatical/conditional operators
ppt on logical/arthimatical/conditional operatorsAmrinder Sidhu
 
Operators and Expressions in C#
Operators and Expressions in C#Operators and Expressions in C#
Operators and Expressions in C#Prasanna Kumar SM
 
Python Programming | JNTUK | UNIT 1 | Lecture 5
Python Programming | JNTUK | UNIT 1 | Lecture 5Python Programming | JNTUK | UNIT 1 | Lecture 5
Python Programming | JNTUK | UNIT 1 | Lecture 5FabMinds
 
Programming presentation
Programming presentationProgramming presentation
Programming presentationFiaz Khokhar
 
2 EPT 162 Lecture 2
2 EPT 162 Lecture 22 EPT 162 Lecture 2
2 EPT 162 Lecture 2Don Dooley
 

Similar to Chapter 3 dti2143 (20)

OPERATORS IN C.pptx
OPERATORS IN C.pptxOPERATORS IN C.pptx
OPERATORS IN C.pptx
 
OPERATORS IN C.pptx
OPERATORS IN C.pptxOPERATORS IN C.pptx
OPERATORS IN C.pptx
 
Cse lecture-4.1-c operators and expression
Cse lecture-4.1-c operators and expressionCse lecture-4.1-c operators and expression
Cse lecture-4.1-c operators and expression
 
Operator in c
Operator in cOperator in c
Operator in c
 
03 Operators and expressions
03 Operators and expressions03 Operators and expressions
03 Operators and expressions
 
Operator in C language
Operator in C languageOperator in C language
Operator in C language
 
Few Operator used in c++
Few Operator used in c++Few Operator used in c++
Few Operator used in c++
 
Operators and Expressions in C++
Operators and Expressions in C++Operators and Expressions in C++
Operators and Expressions in C++
 
programing in c PPT Gaurav Nautiyal.pptx
programing in c PPT Gaurav Nautiyal.pptxprograming in c PPT Gaurav Nautiyal.pptx
programing in c PPT Gaurav Nautiyal.pptx
 
C programming session 02
C programming session 02C programming session 02
C programming session 02
 
Operators expressions-and-statements
Operators expressions-and-statementsOperators expressions-and-statements
Operators expressions-and-statements
 
ppt on logical/arthimatical/conditional operators
ppt on logical/arthimatical/conditional operatorsppt on logical/arthimatical/conditional operators
ppt on logical/arthimatical/conditional operators
 
C program
C programC program
C program
 
Report on c
Report on cReport on c
Report on c
 
What are operators?
What are operators? What are operators?
What are operators?
 
Operators and Expressions in C#
Operators and Expressions in C#Operators and Expressions in C#
Operators and Expressions in C#
 
Operators
OperatorsOperators
Operators
 
Python Programming | JNTUK | UNIT 1 | Lecture 5
Python Programming | JNTUK | UNIT 1 | Lecture 5Python Programming | JNTUK | UNIT 1 | Lecture 5
Python Programming | JNTUK | UNIT 1 | Lecture 5
 
Programming presentation
Programming presentationProgramming presentation
Programming presentation
 
2 EPT 162 Lecture 2
2 EPT 162 Lecture 22 EPT 162 Lecture 2
2 EPT 162 Lecture 2
 

More from alish sha

T22016 – how to answer with ubs 9
T22016 – how to answer with ubs 9T22016 – how to answer with ubs 9
T22016 – how to answer with ubs 9alish sha
 
July 2014 theory exam (theory)
July 2014 theory exam (theory)July 2014 theory exam (theory)
July 2014 theory exam (theory)alish sha
 
Accounting basic equation
Accounting basic equation Accounting basic equation
Accounting basic equation alish sha
 
It 302 computerized accounting (week 2) - sharifah
It 302   computerized accounting (week 2) - sharifahIt 302   computerized accounting (week 2) - sharifah
It 302 computerized accounting (week 2) - sharifahalish sha
 
It 302 computerized accounting (week 1) - sharifah
It 302   computerized accounting (week 1) - sharifahIt 302   computerized accounting (week 1) - sharifah
It 302 computerized accounting (week 1) - sharifahalish sha
 
What are the causes of conflicts (Bahasa Malaysia)
What are the causes of conflicts (Bahasa Malaysia)What are the causes of conflicts (Bahasa Malaysia)
What are the causes of conflicts (Bahasa Malaysia)alish sha
 
Lab 9 sem ii_12_13
Lab 9 sem ii_12_13Lab 9 sem ii_12_13
Lab 9 sem ii_12_13alish sha
 
Lab 10 sem ii_12_13
Lab 10 sem ii_12_13Lab 10 sem ii_12_13
Lab 10 sem ii_12_13alish sha
 
Lab 5 2012/2012
Lab 5 2012/2012Lab 5 2012/2012
Lab 5 2012/2012alish sha
 
Purpose elaborate
Purpose elaboratePurpose elaborate
Purpose elaboratealish sha
 
Test 1 alish schema 1
Test 1 alish schema 1Test 1 alish schema 1
Test 1 alish schema 1alish sha
 
Lab 6 sem ii_11_12
Lab 6 sem ii_11_12Lab 6 sem ii_11_12
Lab 6 sem ii_11_12alish sha
 
Test 1 skema q&a
Test 1 skema q&aTest 1 skema q&a
Test 1 skema q&aalish sha
 
Test 1 skema q&a
Test 1 skema q&aTest 1 skema q&a
Test 1 skema q&aalish sha
 
Final project
Final projectFinal project
Final projectalish sha
 
Final project
Final projectFinal project
Final projectalish sha
 
Attn list test
Attn list testAttn list test
Attn list testalish sha
 
Carry markdam31303
Carry markdam31303Carry markdam31303
Carry markdam31303alish sha
 
Final project
Final projectFinal project
Final projectalish sha
 

More from alish sha (20)

T22016 – how to answer with ubs 9
T22016 – how to answer with ubs 9T22016 – how to answer with ubs 9
T22016 – how to answer with ubs 9
 
July 2014 theory exam (theory)
July 2014 theory exam (theory)July 2014 theory exam (theory)
July 2014 theory exam (theory)
 
Accounting basic equation
Accounting basic equation Accounting basic equation
Accounting basic equation
 
It 302 computerized accounting (week 2) - sharifah
It 302   computerized accounting (week 2) - sharifahIt 302   computerized accounting (week 2) - sharifah
It 302 computerized accounting (week 2) - sharifah
 
It 302 computerized accounting (week 1) - sharifah
It 302   computerized accounting (week 1) - sharifahIt 302   computerized accounting (week 1) - sharifah
It 302 computerized accounting (week 1) - sharifah
 
What are the causes of conflicts (Bahasa Malaysia)
What are the causes of conflicts (Bahasa Malaysia)What are the causes of conflicts (Bahasa Malaysia)
What are the causes of conflicts (Bahasa Malaysia)
 
Lab 9 sem ii_12_13
Lab 9 sem ii_12_13Lab 9 sem ii_12_13
Lab 9 sem ii_12_13
 
Lab 10 sem ii_12_13
Lab 10 sem ii_12_13Lab 10 sem ii_12_13
Lab 10 sem ii_12_13
 
Lab 6
Lab 6Lab 6
Lab 6
 
Lab 5 2012/2012
Lab 5 2012/2012Lab 5 2012/2012
Lab 5 2012/2012
 
Purpose elaborate
Purpose elaboratePurpose elaborate
Purpose elaborate
 
Test 1 alish schema 1
Test 1 alish schema 1Test 1 alish schema 1
Test 1 alish schema 1
 
Lab 6 sem ii_11_12
Lab 6 sem ii_11_12Lab 6 sem ii_11_12
Lab 6 sem ii_11_12
 
Test 1 skema q&a
Test 1 skema q&aTest 1 skema q&a
Test 1 skema q&a
 
Test 1 skema q&a
Test 1 skema q&aTest 1 skema q&a
Test 1 skema q&a
 
Final project
Final projectFinal project
Final project
 
Final project
Final projectFinal project
Final project
 
Attn list test
Attn list testAttn list test
Attn list test
 
Carry markdam31303
Carry markdam31303Carry markdam31303
Carry markdam31303
 
Final project
Final projectFinal project
Final project
 

Chapter 3 dti2143

  • 1. EXPRESSIONS AND OPERATORS CHAPTER 3 DTI 2143 1
  • 2. CONTENTS Arithmetic Operators Assigning Mathematical Operator Combinations Unary Sign Operators Increments And Decrement Operator Conditional Operator Logical Expressions Logical Operator 2 2 CHAPTER 4
  • 3. INTRODUCTION In any programming languages, we need operators to construct statements to do an operation and calculations. In this chapter, you will be introduced to several operators such as: Unary Operators Binary Operators Ternary Operators Operator can be applied to variables or any elements in an expression to produce some kind of computation or action. 3
  • 4.
  • 5. Examples of Unary arithmetic operators Binary arithmetic operators 5
  • 6. Example 1 #include <stdio.h> #include <conio.h> int main(void) { int num= 20; int val=30; num=val+5; /* num=30+5*/ val=num-val; /*val=35-30*/ num=num+2; /*num=35-5*/ val=30/7; /*val=30/7*/ getch(); return 0; } 6
  • 7. Example 2 #include <stdio.h> #include <conio.h> int main(void) { int num= 20; printf (“%d”, num); int val=30; printf (“%d”, val); num=val+5; printf (“%d”, num); val=num-val; printf (“%d”, val); num=num+2; printf (“%d”, num); val=30/7; printf (“%d”, val); getch(); return 0; } 7
  • 8. Example 3 #include <stdio.h> #include <conio.h> int main(void) { int a,b,c,d,result; a=10; b=20; c=15; d=8; result=a*b/(-c*31%13)*d; printf ("%d",result); getch(); return 0; } 8
  • 9.
  • 10. Example 3 #include <stdio.h> #include <conio.h> int main(void) { int num =5; num -=3; num +=4; printf ("%d", num); getch(); return 0; } 10
  • 11. Example 4 total = total / 2; bonus=bonus+800; balance =balance- sum + tax 11
  • 12.
  • 13. The operators are:Unary Increment operators : ++ ++i (prefix) i++ (postfix) Unary Decrement Operators : -- --i (prefix) i-- (postfix) 12
  • 14.
  • 15. Also used as counter in loop structure
  • 17.
  • 20. INCREMENTS OPERATOR /*Output : 1*/ /*Output : 1*/ 14
  • 21.
  • 22. RELATIONAL AND EQUALITY OPERATOR 16
  • 23. Example 1 a = 6; b = 1; c = - 2; 1 1 0 0 17
  • 24.
  • 25. EXAMPLE 1 0(FALSE) 1(TRUE) 0(FALSE) 19
  • 26. EXAMPLE OF QUESTIONS 1) Given: intval, x = 4, y = 3, z = 10; val =(x+y>=3*z) == (x!=3*z+y); The value of val is:  1 0 10 17 20
  • 27. 2) Given: int val, a = 1, b = 2, c = 3, d = 4; val = d+a%c*b; The value of val is: 6 5 0 1 21
  • 28. 3) int cost = 2; int price = 5; cost += ++price * 2;   What is answer for cost? 22
  • 29. 4) Assume count = 21. What is the current value of count at each of these statements?   a) count-- =………. b) ++count =………. 23
  • 30. 5) #include<stdio.h> #include<conio.h> int main() { int n01=39,n02=100; printf("%d",++n01); printf("%d",n01--+2); printf("%d",(--n01)+(++n02)); printf("%d",n01); getch (); return 0; }
  • 31. 6) #include<stdio.h> #include<conio.h> int main() { int x=6,y=6; printf("%d",x++); printf("%d",x); y--; printf("%d %d",x,y); getch (); return 0; }