CPS125

with Prof. Kosta Derpanis

Logical Operators and Branching Part 2

Administration

Readings

Lesson #4 Logical Operators and Selection Statements

Hamelin

4. Logical Operators and Selection Statements - Copyright © Denis Hamelin - Ryerson University

Selection Structures: if and switch Statements

CHAPTER

4

CHAPTER OBJECTIVES • To become familiar with the three kinds of control structures: sequence, selection, and repetition • To understand compound statements • To learn how to compare numbers and characters • To learn how to use the relational, equality, and logical operators to write expressions that are true or false • To learn how to write selection statements that choose between two alternatives in a program using the if statement • To learn how to implement decisions in algorithms using the if statement • To understand how to select among more than two alternatives by nesting if statements • To learn how to use the switch statement as another technique for selecting among multiple alternatives

Hanly and Koffman

Readings

LECTURE TOPICS

LECTURE TOPICS Branching control structures

Control structures

control structures determine the sequence of execution of a set of instructions

3

Control Structures

e c n e u q e S

e c n e u q e S char c;

e c n e u q e S char c;

c = ‘K’;

e c n e u q e S char c;

c = ‘K’;

printf(“%c\n”,c);

s p o Lo

s p o Lo

s p o Lo

condition

s p o Lo

condition

s p o Lo

condition

n o i t c Sele

n o i t c Sele

n o i t c Sele

condition

n o i t c Sele true condition

n o i t c Sele false true condition

Single Branch if (condition) condition is true, execute statement

Single Branch if (condition) condition is true, execute statement

only works for a single s

tatement

int temp; printf(“What is the temperature? ”); scanf(“%d”, &temp); if (temp >= 100) printf(“The water is boiling!\n”);

Console

int temp; printf(“What is the temperature? ”); scanf(“%d”, &temp); if (temp >= 100) printf(“The water is boiling!\n”);

Console

int temp; printf(“What is the temperature? ”); scanf(“%d”, &temp); if (temp >= 100) printf(“The water is boiling!\n”);

Console 101

int temp; printf(“What is the temperature? ”); scanf(“%d”, &temp); if (temp >= 100) printf(“The water is boiling!\n”);

Console 101

int temp; printf(“What is the temperature? ”); scanf(“%d”, &temp); if (temp >= 100) printf(“The water is boiling!\n”);

Console 101

int temp; printf(“What is the temperature? ”); scanf(“%d”, &temp); if (temp >= 100) printf(“The water is boiling!\n”);

Console 101 The water is boiling!

int temp; printf(“What is the temperature? ”); scanf(“%d”, &temp); if (temp >= 100) printf(“The water is boiling!\n”);

Console 101 The water is boiling!

int temp; printf(“What is the temperature? ”); scanf(“%d”, &temp); if (temp >= 100) printf(“The water is boiling!\n”);

Console

int temp; printf(“What is the temperature? ”); scanf(“%d”, &temp); if (temp >= 100) printf(“The water is boiling!\n”);

Console

int temp; printf(“What is the temperature? ”); scanf(“%d”, &temp); if (temp >= 100) printf(“The water is boiling!\n”);

Console 24

int temp; printf(“What is the temperature? ”); scanf(“%d”, &temp); if (temp >= 100) printf(“The water is boiling!\n”);

Console 24

int temp; printf(“What is the temperature? ”); scanf(“%d”, &temp); if (temp >= 100) printf(“The water is boiling!\n”);

SKIP

Console 24

Two Branches if (condition) condition is true, execute statement else condition is false, execute statement

Two Branches if (condition) condition is true, execute statement else condition is false, execute statement

t n e m e t a t s e l g n i s a r o f s k r o only w

int temp; printf(“What is the temperature? ”); scanf(“%d”, &temp); if (temp >= 20) printf(“The temperature is warm\n”); else printf(“The temperature is cool\n”);

Console

int temp; printf(“What is the temperature? ”); scanf(“%d”, &temp); if (temp >= 20) printf(“The temperature is warm\n”); else printf(“The temperature is cool\n”);

Console

int temp; printf(“What is the temperature? ”); scanf(“%d”, &temp); if (temp >= 20) printf(“The temperature is warm\n”); else printf(“The temperature is cool\n”);

Console 15

int temp; printf(“What is the temperature? ”); scanf(“%d”, &temp); if (temp >= 20) printf(“The temperature is warm\n”); else printf(“The temperature is cool\n”);

Console 15

int temp; printf(“What is the temperature? ”); scanf(“%d”, &temp); if (temp >= 20) printf(“The temperature is warm\n”); else printf(“The temperature is cool\n”);

SKIP

Console 15

int temp; printf(“What is the temperature? ”); scanf(“%d”, &temp); if (temp >= 20) printf(“The temperature is warm\n”); else printf(“The temperature is cool\n”);

SKIP

Console 15

int temp; printf(“What is the temperature? ”); scanf(“%d”, &temp); if (temp >= 20) printf(“The temperature is warm\n”); else printf(“The temperature is cool\n”);

SKIP

Console 15 The temperature is cool

int temp; printf(“What is the temperature? ”); scanf(“%d”, &temp); if (temp >= 20) printf(“The temperature is warm\n”); else printf(“The temperature is cool\n”);

SKIP

Console 15 The temperature is cool

int temp; printf(“What is the temperature? ”); scanf(“%d”, &temp); if (temp >= 20) printf(“The temperature is warm\n”); else printf(“The temperature is cool\n”);

Console

int temp; printf(“What is the temperature? ”); scanf(“%d”, &temp); if (temp >= 20) printf(“The temperature is warm\n”); else printf(“The temperature is cool\n”);

Console

int temp; printf(“What is the temperature? ”); scanf(“%d”, &temp); if (temp >= 20) printf(“The temperature is warm\n”); else printf(“The temperature is cool\n”);

Console 20

int temp; printf(“What is the temperature? ”); scanf(“%d”, &temp); if (temp >= 20) printf(“The temperature is warm\n”); else printf(“The temperature is cool\n”);

Console 20

int temp; printf(“What is the temperature? ”); scanf(“%d”, &temp); if (temp >= 20) printf(“The temperature is warm\n”); else printf(“The temperature is cool\n”);

Console 20

int temp; printf(“What is the temperature? ”); scanf(“%d”, &temp); if (temp >= 20) printf(“The temperature is warm\n”); else printf(“The temperature is cool\n”);

Console 20 The temperature is warm

int temp; printf(“What is the temperature? ”); scanf(“%d”, &temp); if (temp >= 20) printf(“The temperature is warm\n”); else printf(“The temperature is cool\n”);

SKIP

Console 20 The temperature is warm

Compoun d Statemen ts int temp; printf(“What is the temperature ”?); scanf(“%d”, &temp); if (temp >= 100) { printf(“WARNING: Water is boiling\n”); printf(“Turn of the heat.\n”); }

Compoun d Statemen ts int temp; printf(“What is the temperature ”?); scanf(“%d”, &temp); if (temp >= 100) { printf(“WARNING: Water is boiling\n”); printf(“Turn of the heat.\n”); }

Compoun d Statemen ts int temp; printf(“What is the temperature ”?); scanf(“%d”, &temp); if (temp >= 100) { printf(“WARNING: Water is boiling\n”); printf(“Turn of the heat.\n”); }

Compoun d Statemen ts int temp; printf(“What is the temperature ”?); scanf(“%d”, &temp); if (temp >= 100) { printf(“WARNING: Water is boiling\n”); printf(“Turn of the heat.\n”); }

Compoun d Statemen ts

} { e s u printf(“What is thea temperature ”?); s y w l A : scanf(“%d”, TIP &temp); int temp;

if (temp >= 100) { printf(“WARNING: Water is boiling\n”); printf(“Turn of the heat.\n”); }

A : P I T

} { e s u s lway

Multiple alternatives

Nested Condition s

if (condition1) condition1 is true, execute statement else if (condition2) condition2 is true, execute statement

noise = 85; ! if (noise <= 50) printf("Quiet"); else if (noise <= 70) printf("Intrusive"); else if (noise <= 90) printf("Deafening"); else printf("Dangerous");

Console

noise = 85; ! if (noise <= 50) printf("Quiet"); else if (noise <= 70) printf("Intrusive"); else if (noise <= 90) printf("Deafening"); else printf("Dangerous");

Console

noise = 85; ! if (noise <= 50) printf("Quiet"); else if (noise <= 70) printf("Intrusive"); else if (noise <= 90) printf("Deafening"); else printf("Dangerous");

Console

noise = 85; ! if (noise <= 50) printf("Quiet"); else if (noise <= 70) printf("Intrusive"); else if (noise <= 90) printf("Deafening"); else printf("Dangerous");

Console

noise = 85; ! if (noise <= 50) printf("Quiet"); else if (noise <= 70) printf("Intrusive"); else if (noise <= 90) printf("Deafening"); else printf("Dangerous");

Console

noise = 85; ! if (noise <= 50) printf("Quiet"); else if (noise <= 70) printf("Intrusive"); else if (noise <= 90) printf("Deafening"); else printf("Dangerous");

Console

noise = 85; ! if (noise <= 50) printf("Quiet"); else if (noise <= 70) printf("Intrusive"); else if (noise <= 90) printf("Deafening"); else printf("Dangerous");

Console

noise = 85; ! if (noise <= 50) printf("Quiet"); else if (noise <= 70) printf("Intrusive"); else if (noise <= 90) printf("Deafening"); else printf("Dangerous");

Console

noise = 85; ! if (noise <= 50) printf("Quiet"); else if (noise <= 70) printf("Intrusive"); else if (noise <= 90) printf("Deafening"); else printf("Dangerous");

Console Deafening

noise = 85; ! if (noise <= 50) printf("Quiet"); else if (noise <= 70) printf("Intrusive"); else if (noise <= 90) printf("Deafening"); else printf("Dangerous");

Console Deafening

noise = 85; ! if (noise <= 50) printf("Quiet"); else if (noise <= 70) printf("Intrusive"); else if (noise <= 90) printf("Deafening"); else printf("Dangerous");

Console Deafening

Order matter s

noise = 85; ! if (noise <= 50) printf("Quiet"); else if (noise <= 70) printf("Intrusive"); else if (noise <= 90) printf("Deafening"); else printf("Dangerous");

Console Deafening

noise = 60; ! if (noise <= 50) printf("Quiet"); else if (noise <= 70) printf("Intrusive"); else if (noise <= 90) printf("Deafening"); else printf("Dangerous");

Console

noise = 60; ! if (noise <= 50) printf("Quiet"); else if (noise <= 70) printf("Intrusive"); else if (noise <= 90) printf("Deafening"); else printf("Dangerous");

What’s the output? Console

noise = 60; ! if (noise <= 50) printf("Quiet"); else if (noise <= 70) printf("Intrusive"); else if (noise <= 90) printf("Deafening"); else printf("Dangerous");

Console Intrusive

noise = 60; ! if (noise <= 50) printf("Quiet"); else if (noise <= 90) printf("Deafening"); else if (noise <= 70) printf("Intrusive"); else printf("Dangerous");

What’s the output? Console

noise = 60; ! if (noise <= 50) printf("Quiet"); else if (noise <= 90) printf("Deafening"); else if (noise <= 70) printf("Intrusive"); else printf("Dangerous");

Console Deafening

Last Week Tonight with John Oliver

if (emissionsTest == true) enableFullEmissionControls(); else disableFullEmissionControls();

Switch

switch (control_value) { case value1: /* statement(s) */ ! break; case value2: /* statement(s) */ break; case value3: /* statement(s) */ ! break; default: /* statement(s) if no case value matches the control value */ }

int or char

switch (control_value) { case value1: /* statement(s) */ ! break; case value2: /* statement(s) */ break; case value3: /* statement(s) */ ! break; default: /* statement(s) if no case value matches the control value */ }

switch (control_value) { case value1: /* statement(s) */ ! break; case value2: /* statement(s) */ break; case value3: /* statement(s) */ ! break; default: /* statement(s) if no case value matches the control value */ }

switch (control_value) { case value1: /* statement(s) */ ! break; case value2: /* statement(s) */ break; case value3: /* statement(s) */ ! break; default: /* statement(s) if no case value matches the control value */ }

switch (control_value) { case value1: /* statement(s) */ ! break; case value2: /* statement(s) */ break; case value3: /* statement(s) */ ! break; default: /* statement(s) if no case value matches the control value */ }

switch (control_value) { case value1: /* statement(s) */ ! break; case value2: /* statement(s) */ break; case value3: /* statement(s) */ ! break; default: /* statement(s) if no case value matches the control value */ }

! ! ! ! ! ! ! ! ! ! ! ! ! ! !

!

if-else shortcut

if (control_value == value1) { /* statement(s) */ } else if (control_value == value2) { /* statement(s) */ } else if (control_value == value3) { /* statement(s) */ } else { /* statement(s) if no case value matches the control value */ }

colour = 'r'; switch(colour) { case 'R': case 'r': printf("Stop!"); break; case 'Y': case 'y': ! printf("Caution!"); break; case 'g': case 'G': ! printf("Go!"); break; default: ! printf("Invalid colour!"); }

colour = 'r';

output?

switch(colour) { case 'R': case 'r': printf("Stop!"); break; case 'Y': case 'y': ! printf("Caution!"); break; case 'g': case 'G': ! printf("Go!"); break; default: ! printf("Invalid colour!"); }

colour = 'r'; switch(colour) { case 'R': case 'r': printf("Stop!"); break; case 'Y': case 'y': ! printf("Caution!"); break; case 'g': case 'G': ! printf("Go!"); break; default: ! printf("Invalid colour!"); }

colour = 'r'; switch(colour) { case 'R': case 'r': printf("Stop!"); break; case 'Y': case 'y': ! printf("Caution!"); break; case 'g': case 'G': ! printf("Go!"); break; default: ! printf("Invalid colour!"); }

colour = 'r'; switch(colour) { case 'R': case 'r': printf("Stop!"); break; case 'Y': case 'y': ! printf("Caution!"); break; case 'g': case 'G': ! printf("Go!"); break; default: ! printf("Invalid colour!"); }

colour = 'r'; switch(colour) { case 'R': case 'r': printf("Stop!"); break; case 'Y': case 'y': ! printf("Caution!"); break; case 'g': case 'G': ! printf("Go!"); break; default: ! printf("Invalid colour!"); }

colour = 'r'; switch(colour) { case 'R': case 'r': printf("Stop!"); break; case 'Y': case 'y': ! printf("Caution!"); break; case 'g': case 'G': ! printf("Go!"); break; default: ! printf("Invalid colour!"); }

colour = 'r'; switch(colour) { case 'R': case 'r': printf("Stop!"); break; case 'Y': case 'y': ! printf("Caution!"); break; case 'g': case 'G': ! printf("Go!"); break; default: ! printf("Invalid colour!"); }

colour = 'R'; switch(colour) { case 'R': case 'r': printf("Stop!"); break; case 'Y': case 'y': ! printf("Caution!"); break; case 'g': case 'G': ! printf("Go!"); break; default: ! printf("Invalid colour!"); }

colour = 'R';

output?

switch(colour) { case 'R': case 'r': printf("Stop!"); break; case 'Y': case 'y': ! printf("Caution!"); break; case 'g': case 'G': ! printf("Go!"); break; default: ! printf("Invalid colour!"); }

colour = 'R'; switch(colour) { case 'R': case 'r': printf("Stop!"); break; case 'Y': case 'y': ! printf("Caution!"); break; case 'g': case 'G': ! printf("Go!"); break; default: ! printf("Invalid colour!"); }

colour = 'R'; switch(colour) { case 'R': case 'r': printf("Stop!"); break; case 'Y': case 'y': ! printf("Caution!"); break; case 'g': case 'G': ! printf("Go!"); break; default: ! printf("Invalid colour!"); }

colour = 'R'; switch(colour) { case 'R': case 'r': printf("Stop!"); break; case 'Y': case 'y': ! printf("Caution!"); break; case 'g': case 'G': ! printf("Go!"); break; default: ! printf("Invalid colour!"); }

colour = 'R'; switch(colour) { case 'R': case 'r': printf("Stop!"); break; case 'Y': case 'y': ! printf("Caution!"); break; case 'g': case 'G': ! printf("Go!"); break; default: ! printf("Invalid colour!"); }

colour = 'R'; switch(colour) { case 'R': case 'r': printf("Stop!"); break; case 'Y': case 'y': ! printf("Caution!"); break; case 'g': case 'G': ! printf("Go!"); break; default: ! printf("Invalid colour!"); }

colour = 'R'; switch(colour) { case 'R': case 'r': printf("Stop!"); break; case 'Y': case 'y': ! printf("Caution!"); break; case 'g': case 'G': ! printf("Go!"); break; default: ! printf("Invalid colour!"); }

colour = 'R'; switch(colour) { case 'R': case 'r': printf("Stop!"); break; case 'Y': case 'y': ! printf("Caution!"); break; case 'g': case 'G': ! printf("Go!"); break; default: ! printf("Invalid colour!"); }

colour = 'B'; switch(colour) { case 'R': case 'r': printf("Stop!"); break; case 'Y': case 'y': ! printf("Caution!"); break; case 'g': case 'G': ! printf("Go!"); break; default: ! printf("Invalid colour!"); }

colour = 'B';

output?

switch(colour) { case 'R': case 'r': printf("Stop!"); break; case 'Y': case 'y': ! printf("Caution!"); break; case 'g': case 'G': ! printf("Go!"); break; default: ! printf("Invalid colour!"); }

colour = 'B'; switch(colour) { case 'R': case 'r': printf("Stop!"); break; case 'Y': case 'y': ! printf("Caution!"); break; case 'g': case 'G': ! printf("Go!"); break; default: ! printf("Invalid colour!"); }

colour = 'B'; switch(colour) { case 'R': case 'r': printf("Stop!"); break; case 'Y': case 'y': ! printf("Caution!"); break; case 'g': case 'G': ! printf("Go!"); break; default: ! printf("Invalid colour!"); }

colour = 'B'; switch(colour) { case 'R': case 'r': printf("Stop!"); break; case 'Y': case 'y': ! printf("Caution!"); break; case 'g': case 'G': ! printf("Go!"); break; default: ! printf("Invalid colour!"); }

colour = 'B'; switch(colour) { case 'R': case 'r': printf("Stop!"); break; case 'Y': case 'y': ! printf("Caution!"); break; case 'g': case 'G': ! printf("Go!"); break; default: ! printf("Invalid colour!"); }

colour = 'B'; switch(colour) { case 'R': case 'r': printf("Stop!"); break; case 'Y': case 'y': ! printf("Caution!"); break; case 'g': case 'G': ! printf("Go!"); break; default: ! printf("Invalid colour!"); }

value = 'A'; switch(value) { case 'A': printf("A "); case 'B': printf("B "); case 'C': printf("C "); case 'D': printf("D "); case 'E': printf("E "); default: ! printf("Default"); }

value = 'A'; switch(value) { case 'A': printf("A "); case 'B': printf("B "); case 'C': printf("C "); case 'D': printf("D "); case 'E': printf("E "); default: ! printf("Default"); }

output?

value = 'A'; switch(value) { case 'A': printf("A "); case 'B': printf("B "); case 'C': printf("C "); case 'D': printf("D "); case 'E': printf("E "); default: ! printf("Default"); }

Console A B C D E Default

s p o Lo

s p o Lo

s p o Lo

condition

s p o Lo

condition

s p o Lo

condition

Spot the ERROR

Spot the ERROR

#include #include int main (void)‫‏‬ { int age = 39; char initial = ‘KGD’; printf(“%c is %d years old\n”, initial, age); }

return (0);

#include #include int main (void)‫‏‬ { int age = 39; char initial = ‘KGD’; printf(“%c is %d years old\n”, initial, age); }

return (0);

#include #include int main (void)‫‏‬ { int age = 39; char initial = ‘KGD’; printf(“%c is %d years old\n”, initial, age); }

return (0);

#include int main (void)‫‏‬ { float a = 10; if (10 == 10 & (a == 10 | a == 1) ) printf(“a equals 1 or 10\n”); }

return 1;

#include int main (void)‫‏‬ { float a = 10; if (10 == 10 & (a == 10 | a == 1) ) printf(“a equals 1 or 10\n”); }

return 1;

#include int main (void)‫‏‬ { float a = 10; if (10 == 10 & (a == 10 | a == 1) ) printf(“a equals 1 or 10\n”); }

return 1;

#include int main (void)‫‏‬ { float a = 10; if (10 == 10 && (a == 10 || a == 1) ) printf(“a equals 1 or 10\n”); }

return 1;

#include int main (void)‫‏‬ { double mark; printf(“Please enter mark:\n”); mark = scanf(“%lf”);

}

if (mark >= 50) printf(“Pass\n”); elseif (mark >=0) printf(“Fail\n”); else { printf(“Invalid entry\n”); }return (0);

#include int main (void)‫‏‬ { double mark; printf(“Please enter mark:\n”); mark = scanf(“%lf”);

}

if (mark >= 50) printf(“Pass\n”); elseif (mark >=0) printf(“Fail\n”); else { printf(“Invalid entry\n”); }return (0);

#include int main (void)‫‏‬ { double mark; printf(“Please enter mark:\n”); mark = scanf(“%lf”);

}

if (mark >= 50) printf(“Pass\n”); elseif (mark >=0) printf(“Fail\n”); else { printf(“Invalid entry\n”); }return (0);

#include int main (void)‫‏‬ { double mark; printf(“Please enter mark:\n”); mark = scanf(“%lf”);

}

if (mark >= 50) printf(“Pass\n”); elseif (mark >=0) printf(“Fail\n”); else { printf(“Invalid entry\n”); }return (0);

#include int main (void)‫‏‬ { char keypress; printf(“Enter temperature:\n”); scanf(“%c”, keypress); if (keypress = ‘x’) { return(1); } }

return(0);

#include int main (void)‫‏‬ { char keypress; printf(“Enter temperature:\n”); scanf(“%c”, keypress); if (keypress = ‘x’) { return(1); } }

return(0);

#include int main (void)‫‏‬ { char keypress; printf(“Enter temperature:\n”); scanf(“%c”,&keypress); if (keypress = ‘x’) { return(1); } }

return(0);

#include int main (void)‫‏‬ { char keypress; printf(“Enter temperature:\n”); scanf(“%c”,&keypress); if (keypress = ‘x’) { return(1); } }

return(0);

#include int main (void)‫‏‬ { float number; if (-100.1) printf(“Enter a number: ”); scanf(“%f”, &number); if (number > 100) printf(“The input is ”); printf(“> 100\n”); else printf(“The input is <= 100”); }

return(0);

#include int main (void)‫‏‬ { float number; if (-100.1) printf(“Enter a number: ”); scanf(“%f”, &number); if (number > 100) printf(“The input is ”); printf(“> 100\n”); else printf(“The input is <= 100”); }

return(0);

#include int main (void)‫‏‬ { float number; if (-100.1) printf(“Enter a number: ”); scanf(“%f”, &number); if (number > 100) printf(“The input is ”); printf(“> 100\n”); else printf(“The input is <= 100”); }

return(0);

#include int main (void)‫‏‬ { float number; if (-100.1) printf(“Enter a number: ”); scanf(“%f”, &number); if (number > 100) { printf(“The input is ”); printf(“> 100\n”); else printf(“The input is <= 100”); }

return(0);

#include int main (void)‫‏‬ { float number; if (-100.1) printf(“Enter a number: ”); scanf(“%f”, &number); if (number > 100) { printf(“The input is ”); printf(“> 100\n”);} else printf(“The input is <= 100”); }

return(0);

#include int main (void)‫‏‬ { int temp; scanf(“Enter a temperature %d”, &temp); if (temp < 0) printf(“It’s cold\n”); else if (0 <= temp <= 25) printf(“It’s warm\n”); else printf(“It’s HOT!!!\n”); }

return(0);

#include int main (void)‫‏‬ { int temp; scanf(“Enter a temperature %d”, &temp); if (temp < 0) printf(“It’s cold\n”); else if (0 <= temp <= 25) printf(“It’s warm\n”); else printf(“It’s HOT!!!\n”); }

return(0);

#include int main (void)‫‏‬ { int temp; scanf(“Enter a temperature %d”, &temp); if (temp < 0) printf(“It’s cold\n”); else if (0 <= temp <= 25) printf(“It’s warm\n”); else printf(“It’s HOT!!!\n”); }

return(0);

#include int main (void)‫‏‬ { int temp; scanf(“Enter a temperature %d”, &temp); if (temp < 0) printf(“It’s cold\n”); else if (0 <= temp <= 25) printf(“It’s warm\n”); else printf(“It’s HOT!!!\n”); }

return(0);

#include int main (void)‫‏‬ { int temp; scanf(“Enter a temperature %d”, &temp); if (temp < 0) printf(“It’s cold\n”); else if (0 <= temp <= 25) printf(“It’s warm\n”); e u r t s y a w l a s i t n e m e else t a t S : R O R R E AL LOGIC printf(“It’s HOT!!!\n”); }

return(0);

int main (void)‫‏‬ { double* ptr; int x = 77; ptr = &55; printf(“ptr is pointing to %lf\n”, *ptr); printf(“sin(%lf) = %lf\n”, 3.1415, sin(3.1415)); }

return (0);

int main (void)‫‏‬ { double* ptr; int x = 77; ptr = &55; printf(“ptr is pointing to %lf\n”, *ptr); printf(“sin(%lf) = %lf\n”, 3.1415, sin(3.1415)); }

return (0);

#include #include int main (void)‫‏‬ { double* ptr; int x = 77; ptr = &55; printf(“ptr is pointing to %lf\n”, *ptr); printf(“sin(%lf) = %lf\n”, 3.1415, sin(3.1415)); }

return (0);

#include #include int main (void)‫‏‬ { double* ptr; int x = 77; ptr = &55; printf(“ptr is pointing to %lf\n”, *ptr); printf(“sin(%lf) = %lf\n”, 3.1415, sin(3.1415)); }

return (0);

Lesson4 - Logical Operators and Branching - Part2.pdf

There was a problem previewing this document. Retrying... Download. Connect more apps... Try one of the apps below to open or edit this item. Lesson4 ...

25MB Sizes 1 Downloads 168 Views

Recommend Documents

Bitwise Operators
to the Cloud! • This is better than WinSCP and a text ... Valgrind. • Pronunciation: val-grinned. • For best results: ... Bitwise Encryption. One-time pad: My string:.

owners and operators - Bell Customer
Feb 10, 2015 - Incorporated to transition all product support responsibility of the Bell 214B ... models, including spare parts supply, technical assistance, and ...

Bitwise Operators
This is better than WinSCP and a text editor. You don't want to do that. ... valgrind –v –leak-check=full . • Gives a report on ... subtree of each node contains only lesser nodes. 2) Right subtree of each node contains only greater nodes. 3) L

Efficient and robust reconstruction of botanical branching structure - HKU
From left to right: 1) Scanned data of an apple tree; 2) Segmentation result, different colors means different ... of the tree, where all points belonging to a cluster.

Logical-And-Relational-Learning-Cognitive-Technologies.pdf ...
This first textbook on multi-relational data mining and inductive logic programming provides a complete overview of the field. It is self-contained and easily accessible for graduate students and practitioners of data mining and machine learning. Thi

Ideal Rationality and Logical Omniscience - PhilPapers
Our best formal theories of rationality imply that it does, but our ... In a slogan, the epistemic role of experience in the apriori domain is not a justifying role, but ...

Logical Fallacies.pdf
There was a problem previewing this document. Retrying... Download. Connect more apps... Try one of the apps below to open or edit this item. Logical ...

JACOBI FORMS AND DIFFERENTIAL OPERATORS
cally studied in the monograph by Eichler-Zagier (see [4]), map Jk,m(N) injectively ... restriction map from Jk,m(N) to Mk(N), the space of elliptic modular forms of ..... that we get (see [12]). (θm,1 |1. 2 ˜ϵ, θm,2 |1. 2 ˜ϵ,...,θm,2m |1. 2 Ë

On closure operators, reflections and ... - Semantic Scholar
By defining a closure operator on effective equivalence relations in a regular cat- egory C, it is possible to establish a bijective correspondence between these closure operators and the regular epireflective subcategories of C, on the model of the

Ideal Rationality and Logical Omniscience - PhilPapers
In a slogan, the epistemic role of experience in the apriori domain is not a justifying role, but rather ..... The first step is that rationality is an ideal of good reasoning: that is to say, being ideally rational requires ...... Watson, G. 1975. F

Span operators
Blackwell Publishing Ltd.Oxford, UK and Malden, USAANALAnalysis0003-26382007 Blackwell Publishing Ltd.January 20076717279ArticlesBerit Brogaard. SPAN OPERATORS. Span operators. BERiT BROGAARD. 1. Tensed plural quantifiers. Presentists typically assen

Monotone Operators without Enlargements
Oct 14, 2011 - concept of the “enlargement of A”. A main example of this usefulness is Rockafellar's proof of maximality of the subdifferential of a convex ...

Logical Effort - Semantic Scholar
D What is the best circuit topology for a function? .... Logical effort extends to multi-stage networks: ..... Asymmetric logic gates favor one input over another.

Monotone Operators without Enlargements
Oct 14, 2011 - the graph of A. This motivates the definition of enlargement of A for a general monotone mapping ... We define the symmetric part a of A via. (8).

A successful Git branching model - nvie.com
release branch for. 1.0. Author: Vincent Driessen. Original blog post: http://nvie.com/posts/a-succesful-git-branching-model. License: Creative Commons BY-SA.Missing:

Subthreshold Logical Effort
account. Wederive a closed-form solution for the correct sizing applications. ... that of regular strong-inversion circuits (Vdd>Vth) due to the small. 2. CONVENTIONAL LOGICALEFFORT ... power savings seen in subthreshold designs. is the logical effor

Biophysical constraints on neuronal branching
After a branching area was chosen and its image was acquired to the computer, the exact geometry .... on to a Master degree at the Physics School, Tel Aviv University. In 1997 she ... Physics University of California, Santa Barbara. In 1984 he ...

Branching-Stable Point Processes
cally distributed according to the distribution of Y (−ln(t)). This operation ...... Fs(1) = e−s without loss of generality (it can be obtain through a linear transformation ...

Constructing coalescent processes from branching ...
Feb 24, 2017 - Λ-coalescents coalescents with multiple collisions introduced by Pitman(1999) λb,k be the transition rate of any k blocks (out of b blocks) merge in one block it is not possible that two such mergers happens at once. Pitman showed th

Logical Fallacies HO.pdf
Use this list of logical fallacies to identify them in your writing and the writing of others. Begging the Question (or circular logic) happens when the writer presents ...

How To Prepare For Data Interpretation and Logical Reasoning For ...
How To Prepare For Data Interpretation and Logical Reasoning For CAT Arun Sharma.pdf. How To Prepare For Data Interpretation and Logical Reasoning For ...Missing: