1 views

Uploaded by Elancheran

- c Lab Programs 1st Year
- csc1
- Sparse Matrices C
- cn
- DSC Singly Linked list Program
- Project
- Http Www Gowrikumar Com c
- ping pong client and server application in tcp
- C&DS MANUAL
- AVL
- rawsockets01.FunctionsExamples
- Networks Lab Manual
- Flight ticket reservation
- code.txt
- 25 programs of C-1 (1).docx
- Operator Types in Java
- C&DS NOTES
- P4HVI.pdf
- Less 6 Point
- ds practical file

You are on page 1of 19

1. Arithmetic operators

2. Relational Operators

3. Logical Operators

4. Assignment Operators

5. Increments and Decrement Operators

6. Conditional Operators

7. Bitwise Operators

8. Special Operators

Arithmetic operators

Operator Meaning

* Multiplication

/ Division

% Modulus Operator

CO2. To gain knowledge about the

control structures in C

Integer Arithmetic

Let x = 27 and y = 5

z=x+y 32

z=x–y 22

z=x*y 115

z=x%y 2

z=x/y 5

control structures in C

Floating point arithmetic

Let x = 14.0 and y = 4.0 then

z=x+y 18.0

z=x–y 10.0

z=x*y 56.0

z=x/y 3.50

control structures in C

Relational Operators

Operator Meaning

== is equal to

!= isCO2.

not equal to

To gain knowledge about the

control structures in C

Relational Expressions

6.5 <= 25 TRUE

-65 > 0 FALSE

10 < 7 + 5 TRUE

control structures in C

Logical Operators

Operator Meaning

|| Logical OR

! Logical NOT

CO2. To gain knowledge about the

control structures in C

Find out the answer

a > b && x = = 10

a < m || a < n

! (x >= y)

a=5

b=4

x=10, y = 9

m=6

n=3

CO2. To gain knowledge about the

control structures in C

Assignment Operators

Statement with simple Statement with

assignment operator shorthand operator

a=a+1 a += 1

a=a–1 a -= 1

a = a * (n+1) a *= (n+1)

a = a / (n+1) a /= (n+1)

a = a %control

b structures in C a %= b

CO2. To gain knowledge about the

What is the output?

#define N 100

#define A 2

main() Output

{

int a; 2

a = A; 4

while (a < N) 16

{ 25

printf(“%d \n”,a);

a *= a;

}

} CO2. To gain knowledge about the

control structures in C

Increment and Decrement Operators

1. ++ v m = 5;

2. v++ y = ++m; (prefix)

After Execution:

3. – –v

y=6, m=6

4. V--

m = 5;

y = m++; (post fix)

After Execution:

y=5, m=6

CO2. To gain knowledge about the control structures

in C

Conditional or Ternary Operator

a = 10;

b = 15;

x = (a > b) ? a : b

in C

Bitwise Operators

Operator Meaning

| Bitwise OR

^ Bitwise Exclusive

>> Shift right

Special Operators

comma operator

size of operator

pointer operators (& and *)

member selection operators (. and ->).

control structures in C

The Comma Operator

value = (x = 10, y = 5, x + y);

In for loops:

for (n=1, m=10, n <=m; n++,m++)

In while loops

While (c=getchar(), c != ‘1’)

Exchanging values

t = x, x = y, y = t;

CO2. To gain knowledge about the

control structures in C

The size of Operator

Operat

m = sizeof (sum);

n = sizeof (long int);

k = sizeof (235L);

control structures in C

What is the output?

main()

{

int a, b, c, d;

a = 15; b = 10; c = ++a-b;

printf (“a = %d, b = %d, c = %d\n”, a,b,c);

d=b++ + a;

printf (“a = %d, b = %d, d = %d\n, a,b,d);

printf (“a / b = %d\n, a / b);

printf (“a %% b = %d\n, a % b);

printf (“a *= b = %d\n, a *= b);

printf (“%d\n, (c > d) ? 1 : 0 );

printf (“%d\n, (c < d) ? 1 : 0 );

}

control structures in C

A=16,b=10,c=

control structures in C

CO2. To gain knowledge about the

control structures in C

- c Lab Programs 1st YearUploaded byu2b11517
- csc1Uploaded byAbhijot Singh
- Sparse Matrices CUploaded byNobody Actually
- cnUploaded byPrasad Vijendra
- DSC Singly Linked list ProgramUploaded bygouse1210
- ProjectUploaded bypraga
- Http Www Gowrikumar Com cUploaded bynehakhandu7885
- ping pong client and server application in tcpUploaded byAmrit Randhawa
- C&DS MANUALUploaded bysiddi gyaneshwar
- AVLUploaded byuranidioticstupid
- rawsockets01.FunctionsExamplesUploaded byMahyuddin Husairi
- Networks Lab ManualUploaded bybinnyj
- Flight ticket reservationUploaded byKoushik Ganesan
- code.txtUploaded byTuanNguyen
- 25 programs of C-1 (1).docxUploaded byAzeem026
- Operator Types in JavaUploaded byETL LABS
- C&DS NOTESUploaded byRamesh Nayudu
- P4HVI.pdfUploaded byThethe Eaux
- Less 6 PointUploaded bySmita R. S.
- ds practical fileUploaded byashu345
- Working With Metal FundamentalsUploaded byleonhard_euler
- Second Summative Test Mathematics Vi (m&d)Uploaded byLeonardo Bruno Jr
- Unit Testing With Test Cases Hints, Tips, And TricksUploaded bylevi'c
- Data structure lab fileUploaded byjayant
- C QUESTIONS How Do You Decide Which Integer Type ToUploaded bysmilesuresh
- CTutorialUploaded byAsit Kumar
- CS 16-Jan 2009Uploaded byChengathirSelvi
- The Processor Instruction Set Provides the Instructions AndUploaded byPrateek
- vhdl2Uploaded bysatryabagas
- Data Structure LabUploaded byHasker Edition

- QGNPUploaded byAfonso Tsukamoto
- 7 Uncertainty Analysis - Part 2Uploaded byIwan Kurniawan
- FEH253-1 Symulator ExpertUploaded bypratik
- Papyrus Sequence DiagramUploaded bykeylamacharet
- Rr059211201 Advanced Data Structures AlgorithmsUploaded byandhracolleges
- nishant.cUploaded byNishant Kashyap
- Hostel Management SystemUploaded byYashwanth Reddy
- LinearProgramming1.docxUploaded byÖzlem Yurtsever
- Hierarchical Testbench Configuration Using UvmUploaded byamigottp
- Back to the Future - The Story of SqueakUploaded byMatthew Wells
- CV Adrian Del Campo EnglishUploaded byacampoh
- SQL Interview Questions for TesterUploaded byShibly Amin
- Laptoppp HpUploaded byFarih N Fiqi
- Get PLC TimeUploaded byNUMBER ONE
- Stored-Procedures-Assignment.docxUploaded byobee1234
- AsmUploaded byMohamed Saleem
- CD Lab ManualUploaded bySuryakumar Bendalam
- SQL_FAQ.docUploaded byJyoti Bansal
- QueryUploaded bydanny
- Advance Java-2..Sem 6Uploaded byGunjan Pratim Jadhav
- b0400df - Hlbl Users GuideUploaded byfadhel
- Blowfish Algorithm in cUploaded bytituverma
- Ex LISPUploaded byThinh Dang
- Scope and Limtation of the StudyUploaded bychandy Rendaje
- Matlab Binary Example.pdfUploaded byAkhil Gupta
- 70-433Uploaded byLeonardo Brandão Cantanhede
- Drease WinCppProject FileSizeUploaded byCleiton Loiola
- OptimizationUploaded bysamson_packiaraj1325
- Short Tutorial IpoptUploaded byCarloyos Hoyos
- BucBal_05.pdfUploaded byLeomar Acosta Ballesteros