SlideShare ist ein Scribd-Unternehmen logo
1 von 107
Slide 1
Lecture
03
Slide 2
Loop Basics
Slide 3
Loop Types
 Sentinel
 while
 do-while
 Counting
 for
Slide 4
Sentinel Loops
Slide 5
while Syntax
while(test condition)
{
statement
}
Slide 6
When a program encounters a while loop, the test
condition is evaluated first. If the condition is TRUE,
the program executes the body of the loop. The
program then returns to the test condition and
reevaluates. If the condition is still TRUE, the body
executes again.
while Syntax
Slide 7
Example #1
while (7)
cout << “hello” << endl;
Slide 8
Example #2
#include<iostream>
using namespace std;
int main()
{
int input;
cout <<"enter number between 5 and 89, inclusive: ";
cin >> input;
while (input < 5 || input > 89)
{
cout << "that value is unacceptable... try again: ";
cin >> input;
}
cout << "the value"<<input<< "is in the interval[5, 89]"<< endl;
cin.get();
//system("PAUSE");
return 0;
}
Slide 9
Example #3
#include<iostream>
using namespace std;
int main()
{
long sum = 0;
int counter = 1;
while (counter<=100)
{
sum += counter;
counter++ ;
}
cout << "sum of first 100 integers is "<< sum ;
cin.get();
system("PAUSE");
return 0;
}
do-while Syntax
Do
{
statement
}
while (test condition);
Copyright © 2003 Pearson Education, Inc. Slide 11
The do-while loop is similar to the while loop, except
that the test condition occurs at the end of the loop.
The do-while loop is an exit-condition loop. This
means that the body of the loop is always executed
first. Then, the test condition is evaluated. If the test
condition is TRUE, the program executes the body of
the loop again. If the test condition is FALSE, the loop
terminates and program execution continues with the
statement following the while.
do-while Syntax
Slide 12
Example #1
do{
cout << "Enter an integer between 2 and 174 (inclusive)"
<< "that is a multiple of 3: ";
cin >> input;
}
while (!(input >= 2 && input <= 174 && input%3 == 0));
Slide 13
Counting Loops
Slide 14
for Syntax
for (startExpression; testExpression; countExpression)
}
statement
}
Slide 15
• The startExpression is evaluated before the loop begins. It is
acceptable to declare and assign in the startExpression(such as int x =
1;).
• This startExpression is evaluated only once at the beginning of the loop.
• The testExpression will evaluate to TRUE (nonzero) or FALSE (zero).
While TRUE, the body of the loop repeats. When the testExpression
becomes FALSE, the looping stops and the program continues with the
statement immediately following the for loop body in the program code.
• The countExpression executes after each trip through the loop. The
count may increase/decrease by an increment of 1 or of some other
value.
• Braces are not required if the body of the for loop consists of only ONE
statement. Please indent the body of the loop for readability.
for Syntax
Slide 16
Example #1
int max;
float average;
long sum = 0;
short i = 0;
cout << "enter positive integer: ";
cin >> max;
for(i=0; i <= max; i++)
sum += i;
average = sum/max;
cout << "average is " << average << endl;
Slide 17
Goal Output
* * * * *
* * * *
* * *
* *
*
Example #2
Slide 18
Outputting 5 Lines
for (int i = 1; i <= 5; i++)
{
cout << endl;
}
Slide 19
Outputting 5 Stars
for (int i = 1; i <= 5; i++)
{
cout << “* ”;
}
Slide 20
Combining
for (int i = 1; i <= 5; i++)
{
for (int j = 1; j <= 5; j++)
cout << "* ";
cout << endl;
}
output
i=1
j=?
variable values
Slide 21
Combining
for (int i = 1; i <= 5; i++)
{
for (int j = 1; j <= 5; j++)
cout << "* ";
cout << endl;
}
output
i=1
j=?
variable values
Slide 22
Combining
for (int i = 1; i <= 5; i++)
{
for (int j = 1; j <= 5; j++)
cout << "* ";
cout << endl;
}
output
i=1
j=1
variable values
Slide 23
Combining
for (int i = 1; i <= 5; i++)
{
for (int j = 1; j <= 5; j++)
cout << "* ";
cout << endl;
}
*
output
i=1
j=1
variable values
Slide 24
Combining
for (int i = 1; i <= 5; i++)
{
for (int j = 1; j <= 5; j++)
cout << "* ";
cout << endl;
}
*
output
i=1
j=2
variable values
Slide 25
Combining
for (int i = 1; i <= 5; i++)
{
for (int j = 1; j <= 5; j++)
cout << "* ";
cout << endl;
}
* *
output
i=1
j=2
variable values
Slide 26
Combining
for (int i = 1; i <= 5; i++)
{
for (int j = 1; j <= 5; j++)
cout << "* ";
cout << endl;
}
* *
output
i=1
j=3
variable values
Slide 27
Combining
for (int i = 1; i <= 5; i++)
{
for (int j = 1; j <= 5; j++)
cout << "* ";
cout << endl;
}
* * *
output
i=1
j=3
variable values
Slide 28
Combining
for (int i = 1; i <= 5; i++)
{
for (int j = 1; j <= 5; j++)
cout << "* ";
cout << endl;
}
* * *
output
i=1
j=4
variable values
Slide 29
Combining
for (int i = 1; i <= 5; i++)
{
for (int j = 1; j <= 5; j++)
cout << "* ";
cout << endl;
}
* * * *
output
i=1
j=4
variable values
Slide 30
Combining
for (int i = 1; i <= 5; i++)
{
for (int j = 1; j <= 5; j++)
cout << "* ";
cout << endl;
}
* * * *
output
i=1
j=5
variable values
Slide 31
Combining
for (int i = 1; i <= 5; i++)
{
for (int j = 1; j <= 5; j++)
cout << "* ";
cout << endl;
}
* * * * *
output
i=1
j=5
variable values
Slide 32
Combining
for (int i = 1; i <= 5; i++)
{
for (int j = 1; j <= 5; j++)
cout << "* ";
cout << endl;
}
* * * * *
output
i=1
j=6
variable values
Slide 33
Combining
for (int i = 1; i <= 5; i++)
{
for (int j = 1; j <= 5; j++)
cout << "* ";
cout << endl;
}
* * * * *
output
i=1
j=6
variable values
Slide 34
Combining
for (int i = 1; i <= 5; i++)
{
for (int j = 1; j <= 5; j++)
cout << "* ";
cout << endl;
}
* * * * *
output
i=2
j=?
variable values
Slide 35
Combining
for (int i = 1; i <= 5; i++)
{
for (int j = 1; j <= 5; j++)
cout << "* ";
cout << endl;
}
* * * * *
output
i=2
j=1
variable values
Slide 36
Combining
for (int i = 1; i <= 5; i++)
{
for (int j = 1; j <= 5; j++)
cout << "* ";
cout << endl;
}
* * * * *
*
output
i=2
j=1
variable values
Slide 37
Combining
for (int i = 1; i <= 5; i++)
{
for (int j = 1; j <= 5; j++)
cout << "* ";
cout << endl;
}
* * * * *
*
output
i=2
j=2
variable values
Slide 38
Combining
for (int i = 1; i <= 5; i++)
{
for (int j = 1; j <= 5; j++)
cout << "* ";
cout << endl;
}
* * * * *
* *
output
i=2
j=2
variable values
Slide 39
Combining
for (int i = 1; i <= 5; i++)
{
for (int j = 1; j <= 5; j++)
cout << "* ";
cout << endl;
}
* * * * *
* *
output
i=2
j=3
variable values
Slide 40
Combining
for (int i = 1; i <= 5; i++)
{
for (int j = 1; j <= 5; j++)
cout << "* ";
cout << endl;
}
* * * * *
* * *
output
i=2
j=3
variable values
Slide 41
Combining
for (int i = 1; i <= 5; i++)
{
for (int j = 1; j <= 5; j++)
cout << "* ";
cout << endl;
}
* * * * *
* * *
output
i=2
j=4
variable values
Slide 42
Combining
for (int i = 1; i <= 5; i++)
{
for (int j = 1; j <= 5; j++)
cout << "* ";
cout << endl;
}
* * * * *
* * * *
output
i=2
j=4
variable values
Combining
for (int i = 1; i <= 5; i++)
{
for (int j = 1; j <= 5; j++)
cout << "* ";
cout << endl;
}
* * * * *
* * * *
output
i=2
j=5
variable values
Slide 44
Combining
for (int i = 1; i <= 5; i++)
{
for (int j = 1; j <= 5; j++)
cout << "* ";
cout << endl;
}
* * * * *
* * * * *
output
i=2
j=5
variable values
oops!!!
Slide 45
Goal vs Actual
Goal
* * * * *
* * * *
* * *
* *
*
Actual
* * * * *
* * * * *
* * * * *
* * * * *
* * * * *
j=1
j=2
j=3
j=4
j=5
i=1
i=2
i=3
i=4
i=5
Slide 46
Fixed
for (int i=1; i <= 5; i++)
{
for (int j=1; j <= 5 – i + 1; j++)
cout << "* ";
cout << endl;
}
output
i=1
j=?
variable values
Slide 47
Fixed
for (int i=1; i <= 5; i++)
{
for (int j=1; j <= 5 – i + 1; j++)
cout << "* ";
cout << endl;
}
output
i=1
j=1
variable values
Slide 48
Fixed
for (int i=1; i <= 5; i++)
{
for (int j=1; j <= 5 – i + 1; j++)
cout << "* ";
cout << endl;
}
*
output
i=1
j=1
variable values
Slide 49
Fixed
for (int i=1; i <= 5; i++)
{
for (int j=1; j <= 5 – i + 1; j++)
cout << "* ";
cout << endl;
}
*
output
i=1
j=2
variable values
Slide 50
Fixed
for (int i=1; i <= 5; i++)
{
for (int j=1; j <= 5 – i + 1; j++)
cout << "* ";
cout << endl;
}
* *
output
i=1
j=2
variable values
Slide 51
Fixed
for (int i=1; i <= 5; i++)
{
for (int j=1; j <= 5 – i + 1; j++)
cout << "* ";
cout << endl;
}
* *
output
i=1
j=3
variable values
Slide 52
Fixed
for (int i=1; i <= 5; i++)
{
for (int j=1; j <= 5 – i + 1; j++)
cout << "* ";
cout << endl;
}
* * *
output
i=1
j=3
variable values
Slide 53
Fixed
for (int i=1; i <= 5; i++)
{
for (int j=1; j <= 5 – i + 1; j++)
cout << "* ";
cout << endl;
}
* * *
output
i=1
j=4
variable values
Slide 54
Fixed
for (int i=1; i <= 5; i++)
{
for (int j=1; j <= 5 – i + 1; j++)
cout << "* ";
cout << endl;
}
* * * *
output
i=1
j=4
variable values
Slide 55
Fixed
for (int i=1; i <= 5; i++)
{
for (int j=1; j <= 5 – i + 1; j++)
cout << "* ";
cout << endl;
}
* * * * *
output
i=1
j=5
variable values
Slide 56
Fixed
for (int i=1; i <= 5; i++)
{
for (int j=1; j <= 5 – i + 1; j++)
cout << "* ";
cout << endl;
}
* * * * *
output
i=1
j=6
variable values
Slide 57
Fixed
for (int i=1; i <= 5; i++)
{
for (int j=1; j <= 5 – i + 1; j++)
cout << "* ";
cout << endl;
}
* * * * *
output
i=1
j=6
variable values
Slide 58
Fixed
for (int i=1; i <= 5; i++)
{
for (int j=1; j <= 5 – i + 1; j++)
cout << "* ";
cout << endl;
}
* * * * *
output
i=2
j=?
variable values
Slide 59
Fixed
for (int i=1; i <= 5; i++)
{
for (int j=1; j <= 5 – i + 1; j++)
cout << "* ";
cout << endl;
}
* * * * *
output
i=2
j=1
variable values
Slide 60
Fixed
for (int i=1; i <= 5; i++)
{
for (int j=1; j <= 5 – i + 1; j++)
cout << "* ";
cout << endl;
}
* * * * *
*
output
i=2
j=1
variable values
Slide 61
Fixed
for (int i=1; i <= 5; i++)
{
for (int j=1; j <= 5 – i + 1; j++)
cout << "* ";
cout << endl;
}
* * * * *
*
output
i=2
j=2
variable values
Slide 62
Fixed
for (int i=1; i <= 5; i++)
{
for (int j=1; j <= 5 – i + 1; j++)
cout << "* ";
cout << endl;
}
* * * * *
* *
output
i=2
j=2
variable values
Slide 63
Fixed
for (int i=1; i <= 5; i++)
{
for (int j=1; j <= 5 – i + 1; j++)
cout << "* ";
cout << endl;
}
* * * * *
* *
output
i=2
j=3
variable values
Slide 64
Fixed
for (int i=1; i <= 5; i++)
{
for (int j=1; j <= 5 – i + 1; j++)
cout << "* ";
cout << endl;
}
* * * * *
* * *
output
i=2
j=3
variable values
Slide 65
Fixed
for (int i=1; i <= 5; i++)
{
for (int j=1; j <= 5 – i + 1; j++)
cout << "* ";
cout << endl;
}
* * * * *
* * *
output
i=2
j=4
variable values
Slide 66
Fixed
for (int i=1; i <= 5; i++)
{
for (int j=1; j <= 5 – i + 1; j++)
cout << "* ";
cout << endl;
}
* * * * *
* * * *
output
i=2
j=4
variable values
Slide 67
Fixed
for (int i=1; i <= 5; i++)
{
for (int j=1; j <= 5 – i + 1; j++)
cout << "* ";
cout << endl;
}
* * * * *
* * * *
output
i=2
j=5
variable values
Slide 68
Fixed
for (int i=1; i <= 5; i++)
{
for (int j=1; j <= 5 – i + 1; j++)
cout << "* ";
cout << endl;
}
* * * * *
* * * *
output
i=2
j=5
variable values
Slide 69
Fixed
for (int i=1; i <= 5; i++)
{
for (int j=1; j <= 5 – i + 1; j++)
cout << "* ";
cout << endl;
}
* * * * *
* * * *
output
i=3
j=?
variable values
Slide 70
Fixed
for (int i=1; i <= 5; i++)
{
for (int j=1; j <= 5 – i + 1; j++)
cout << "* ";
cout << endl;
}
* * * * *
* * * *
output
i=3
j=1
variable values
Slide 71
Fixed
for (int i=1; i <= 5; i++)
{
for (int j=1; j <= 5 – i + 1; j++)
cout << "* ";
cout << endl;
}
* * * * *
* * * *
*
output
i=3
j=1
variable values
Slide 72
Fixed
for (int i=1; i <= 5; i++)
{
for (int j=1; j <= 5 – i + 1; j++)
cout << "* ";
cout << endl;
}
* * * * *
* * * *
*
output
i=3
j=2
variable values
Fixed
for (int i=1; i <= 5; i++)
{
for (int j=1; j <= 5 – i + 1; j++)
cout << "* ";
cout << endl;
}
* * * * *
* * * *
* *
output
i=3
j=2
variable values
Slide 74
Fixed
for (int i=1; i <= 5; i++)
{
for (int j=1; j <= 5 – i + 1; j++)
cout << "* ";
cout << endl;
}
* * * * *
* * * *
* *
output
i=3
j=3
variable values
Slide 75
Fixed
for (int i=1; i <= 5; i++)
{
for (int j=1; j <= 5 – i + 1; j++)
cout << "* ";
cout << endl;
}
* * * * *
* * * *
* * *
output
i=3
j=3
variable values
Slide 76
Fixed
for (int i=1; i <= 5; i++)
{
for (int j=1; j <= 5 – i + 1; j++)
cout << "* ";
cout << endl;
}
* * * * *
* * * *
* * *
output
i=3
j=4
variable values
Slide 77
Fixed
for (int i=1; i <= 5; i++)
{
for (int j=1; j <= 5 – i + 1; j++)
cout << "* ";
cout << endl;
}
* * * * *
* * * *
* * *
output
i=3
j=4
variable values
Slide 78
Fixed
for (int i=1; i <= 5; i++)
{
for (int j=1; j <= 5 – i + 1; j++)
cout << "* ";
cout << endl;
}
* * * * *
* * * *
* * *
output
i=4
j=?
variable values
Slide 79
Fixed
for (int i=1; i <= 5; i++)
{
for (int j=1; j <= 5 – i + 1; j++)
cout << "* ";
cout << endl;
}
* * * * *
* * * *
* * *
output
i=4
j=1
variable values
Fixed
for (int i=1; i <= 5; i++)
{
for (int j=1; j <= 5 – i + 1; j++)
cout << "* ";
cout << endl;
}
* * * * *
* * * *
* * *
*
output
i=4
j=1
variable values
Slide 81
Fixed
for (int i=1; i <= 5; i++)
{
for (int j=1; j <= 5 – i + 1; j++)
cout << "* ";
cout << endl;
}
* * * * *
* * * *
* * *
*
output
i=4
j=2
variable values
Slide 82
Fixed
for (int i=1; i <= 5; i++)
{
for (int j=1; j <= 5 – i + 1; j++)
cout << "* ";
cout << endl;
}
* * * * *
* * * *
* * *
* *
output
i=4
j=2
variable values
Slide 83
Fixed
for (int i=1; i <= 5; i++)
{
for (int j=1; j <= 5 – i + 1; j++)
cout << "* ";
cout << endl;
}
* * * * *
* * * *
* * *
* *
output
i=4
j=3
variable values
Slide 84
Fixed
for (int i=1; i <= 5; i++)
{
for (int j=1; j <= 5 – i + 1; j++)
cout << "* ";
cout << endl;
}
* * * * *
* * * *
* * *
* *
output
i=4
j=3
variable values
Slide 85
Fixed
for (int i=1; i <= 5; i++)
{
for (int j=1; j <= 5 – i + 1; j++)
cout << "* ";
cout << endl;
}
* * * * *
* * * *
* * *
* *
output
i=5
j=?
variable values
Slide 86
Fixed
for (int i=1; i <= 5; i++)
{
for (int j=1; j <= 5 – i + 1; j++)
cout << "* ";
cout << endl;
}
* * * * *
* * * *
* * *
* *
output
i=5
j=1
variable values
Slide 87
Fixed
for (int i=1; i <= 5; i++)
{
for (int j=1; j <= 5 – i + 1; j++)
cout << "* ";
cout << endl;
}
* * * * *
* * * *
* * *
* *
*
output
i=5
j=1
variable values
Slide 88
Fixed
for (int i=1; i <= 5; i++)
{
for (int j=1; j <= 5 – i + 1; j++)
cout << "* ";
cout << endl;
}
* * * * *
* * * *
* * *
* *
*
output
i=5
j=2
variable values
Slide 89
Fixed
for (int i=1; i <= 5; i++)
{
for (int j=1; j <= 5 – i + 1; j++)
cout << "* ";
cout << endl;
}
* * * * *
* * * *
* * *
* *
*
output
i=5
j=2
variable values
Slide 90
Fixed
for (int i=1; i <= 5; i++)
{
for (int j=1; j <= 5 – i + 1; j++)
cout << "* ";
cout << endl;
}
* * * * *
* * * *
* * *
* *
*
output
i=6
j=?
variable values
Slide 91
Fixed
for (int i=1; i <= 5; i++)
{
for (int j=1; j <= 5 – i + 1; j++)
cout << "* ";
cout << endl;
}
* * * * *
* * * *
* * *
* *
*
output
i=6
j=?
variable values
Slide 92
* * * * *
* * * *
* * *
* *
*
Slide 93
Solution Rows
for (short i = 0; i < 5; i++)
{
for (short j = 1; j <= i; j++)
cout << " ";
for (short j = i; j < 5; j++)
cout << "* ";
cout << endl;
}
* * * * *
* * * *
* * *
* *
*
Slide 94
Solution Spaces
for (short i = 0; i < 5; i++)
{
for (short j = 1; j <= i; j++)
cout << " ";
for (short j = i; j < 5; j++)
cout << "* ";
cout << endl;
}
* * * * *
* * * *
* * *
* *
*
Slide 95
Solution Stars
for (short i = 0; i < 5; i++)
{
for (short j = 1; j <= i; j++)
cout << " ";
for (short j = i; j < 5; j++)
cout << "* ";
cout << endl;
}
* * * * *
* * * *
* * *
* *
*
Slide 96
Random Number Generation
Slide 97
rand()
#include <iostream>
using namespace std;
int main()
{
for(int i = 1; i <= 10; i++)
cout << rand() << endl;
return 0;
}
Slide 98
rand()
#include <iostream>
using namespace std;
int main()
{
for(int i = 1; i <= 10; i++)
cout << rand() << endl;
return 0;
}
38457
733887
7384
94877
243
3994452
374008
23146
11833432
237844
First Execution
Slide 99
rand()
#include <iostream>
using namespace std;
int main()
{
for(int i = 1; i <= 10; i++)
cout << rand() << endl;
return 0;
}
38457
733887
7384
94877
243
3994452
374008
23146
11833432
237844
First Execution
38457
733887
7384
94877
243
3994452
374008
23146
11833432
237844
Second Executio
Slide 100
Pseudo-Random Generation
The numbers aren't actually random -- they're generated by a formula,
so they're just pseudorandom.
Slide 101
The pseudo-random number generator is initialized using the argument
passed as seed.
For every different seed value used in a call to srandsrand, the pseudo-randompseudo-random
number generatornumber generator can be expected to generate a different succession of
results in the subsequent calls to rand.
Two different initializations with the same seed will generate the same
succession of results in subsequent calls to rand.
In order to generate random-like numbers, srandsrand is usually initialized to some
distinctive runtime value, like the value returned by function time (declared in
header <ctime><ctime>). This is distinctive enough for most trivial randomization
needs.
Slide 102
srand()
#include <iostream>
#include <ctime>
#include <cstdlib>
using namespace std;
int main()
{
srand(time(NULL));
for(int i = 1; i <= 10; i++)
cout << rand() << endl;
return 0;
}
Slide 103
srand()
#include <iostream>
#include <ctime>
#include <cstdlib>
using namespace std;
int main()
{
srand(time(NULL));
for(int i = 1; i <= 10; i++)
cout << rand() << endl;
return 0;
}
464
53735
342
23
6578
889
93723
7165
7422457
78614
First Execution
Slide 104
srand()
#include <iostream>
#include <ctime>
#include <cstdlib>
using namespace std;
int main()
{
srand(time(NULL));
for(int i = 1; i <= 10; i++)
cout << rand() << endl;
return 0;
}
464
53735
342
23
6578
889
93723
7165
7422457
78614
First Execution
6877
245768
215
57618
78511
79738
3461
175117
35
257868
Second Execution
Slide 105
limiting range: [0, MAX_RAND]
#include <iostream>
#include <ctime>
#include <cstdlib>
using namespace std;
int main()
{
long next_value;
srand(time(NULL));
for (int i = 1; i <= 100000; i++)
if (rand()%100 <= 34)
cout << "hello" << endl; // ~35,000 times
else
cout << "goodbye" << endl; // ~65,000 times
return 0;
}
Slide 106
#include <iostream>
using namespace std;
void main ()
{
int x, y;
double z;
if(typeid(x) == typeid(y))
cout << "x and y are of same type."<<endl;
else
cout<< "x and y are of different type. " <<endl;
cout << "The type of z is "<< typeid(z).name()<<endl;
cout<< "The type of y is "<< typeid(y).name() << endl;
}
typeid ()
The expected output of the program is given below.
x and y are of same type.
The type of z is double
The type of y is int
The operator typeid () identifies the type of variable. Here we only show the use
of the operator. It returns reference to type of its argument. It is coded as:
typeid(object);
Slide 107

Weitere ähnliche Inhalte

Was ist angesagt?

All VLSI programs
All VLSI programsAll VLSI programs
All VLSI programsGouthaman V
 
Java căn bản - Chapter6
Java căn bản - Chapter6Java căn bản - Chapter6
Java căn bản - Chapter6Vince Vo
 
Как работает LLVM бэкенд в C#. Егор Богатов ➠ CoreHard Autumn 2019
Как работает LLVM бэкенд в C#. Егор Богатов ➠ CoreHard Autumn 2019Как работает LLVM бэкенд в C#. Егор Богатов ➠ CoreHard Autumn 2019
Как работает LLVM бэкенд в C#. Егор Богатов ➠ CoreHard Autumn 2019corehard_by
 
Building Hierarchy
Building HierarchyBuilding Hierarchy
Building HierarchyMohamed Samy
 
Programming with GUTs
Programming with GUTsProgramming with GUTs
Programming with GUTsKevlin Henney
 
Property-Based Testing
Property-Based TestingProperty-Based Testing
Property-Based TestingShai Geva
 
Lucio Floretta - TensorFlow and Deep Learning without a PhD - Codemotion Mila...
Lucio Floretta - TensorFlow and Deep Learning without a PhD - Codemotion Mila...Lucio Floretta - TensorFlow and Deep Learning without a PhD - Codemotion Mila...
Lucio Floretta - TensorFlow and Deep Learning without a PhD - Codemotion Mila...Codemotion
 
Introduction to AspectJ
Introduction to AspectJIntroduction to AspectJ
Introduction to AspectJmukhtarhudaya
 
Functional Concepts for OOP Developers
Functional Concepts for OOP DevelopersFunctional Concepts for OOP Developers
Functional Concepts for OOP Developersbrweber2
 
ITT 2014 - Eric Lafortune - ProGuard, Optimizer and Obfuscator in the Android...
ITT 2014 - Eric Lafortune - ProGuard, Optimizer and Obfuscator in the Android...ITT 2014 - Eric Lafortune - ProGuard, Optimizer and Obfuscator in the Android...
ITT 2014 - Eric Lafortune - ProGuard, Optimizer and Obfuscator in the Android...Istanbul Tech Talks
 
EcmaScript unchained
EcmaScript unchainedEcmaScript unchained
EcmaScript unchainedEduard Tomàs
 
Circles graphic
Circles graphicCircles graphic
Circles graphicalldesign
 

Was ist angesagt? (20)

All VLSI programs
All VLSI programsAll VLSI programs
All VLSI programs
 
Modeling FSMs
Modeling FSMsModeling FSMs
Modeling FSMs
 
C++: Interface as Concept
C++: Interface as ConceptC++: Interface as Concept
C++: Interface as Concept
 
Reversible booth ppt
Reversible booth pptReversible booth ppt
Reversible booth ppt
 
Chap08alg
Chap08algChap08alg
Chap08alg
 
Functional C++
Functional C++Functional C++
Functional C++
 
Verilogforlab
VerilogforlabVerilogforlab
Verilogforlab
 
Java căn bản - Chapter6
Java căn bản - Chapter6Java căn bản - Chapter6
Java căn bản - Chapter6
 
MVC meets Monad
MVC meets MonadMVC meets Monad
MVC meets Monad
 
Как работает LLVM бэкенд в C#. Егор Богатов ➠ CoreHard Autumn 2019
Как работает LLVM бэкенд в C#. Егор Богатов ➠ CoreHard Autumn 2019Как работает LLVM бэкенд в C#. Егор Богатов ➠ CoreHard Autumn 2019
Как работает LLVM бэкенд в C#. Егор Богатов ➠ CoreHard Autumn 2019
 
Building Hierarchy
Building HierarchyBuilding Hierarchy
Building Hierarchy
 
Programming with GUTs
Programming with GUTsProgramming with GUTs
Programming with GUTs
 
Property-Based Testing
Property-Based TestingProperty-Based Testing
Property-Based Testing
 
Lucio Floretta - TensorFlow and Deep Learning without a PhD - Codemotion Mila...
Lucio Floretta - TensorFlow and Deep Learning without a PhD - Codemotion Mila...Lucio Floretta - TensorFlow and Deep Learning without a PhD - Codemotion Mila...
Lucio Floretta - TensorFlow and Deep Learning without a PhD - Codemotion Mila...
 
Introduction to AspectJ
Introduction to AspectJIntroduction to AspectJ
Introduction to AspectJ
 
Functional Concepts for OOP Developers
Functional Concepts for OOP DevelopersFunctional Concepts for OOP Developers
Functional Concepts for OOP Developers
 
ITT 2014 - Eric Lafortune - ProGuard, Optimizer and Obfuscator in the Android...
ITT 2014 - Eric Lafortune - ProGuard, Optimizer and Obfuscator in the Android...ITT 2014 - Eric Lafortune - ProGuard, Optimizer and Obfuscator in the Android...
ITT 2014 - Eric Lafortune - ProGuard, Optimizer and Obfuscator in the Android...
 
Los dskn
Los dsknLos dskn
Los dskn
 
EcmaScript unchained
EcmaScript unchainedEcmaScript unchained
EcmaScript unchained
 
Circles graphic
Circles graphicCircles graphic
Circles graphic
 

Ähnlich wie 2621008 - C++ 3

Introduction to ES2015
Introduction to ES2015Introduction to ES2015
Introduction to ES2015kiranabburi
 
Project_Euler_No_104_Pandigital_Fibonacci_ends
Project_Euler_No_104_Pandigital_Fibonacci_endsProject_Euler_No_104_Pandigital_Fibonacci_ends
Project_Euler_No_104_Pandigital_Fibonacci_ends? ?
 
Midterm cpp q_a_may_2014(2)
Midterm cpp q_a_may_2014(2)Midterm cpp q_a_may_2014(2)
Midterm cpp q_a_may_2014(2)Mzr Zia
 
Cs1123 8 functions
Cs1123 8 functionsCs1123 8 functions
Cs1123 8 functionsTAlha MAlik
 
how to reuse code
how to reuse codehow to reuse code
how to reuse codejleed1
 
2014 computer science_question_paper
2014 computer science_question_paper2014 computer science_question_paper
2014 computer science_question_papervandna123
 
شرح مقرر البرمجة 2 لغة جافا - الوحدة الثالثة
شرح مقرر البرمجة 2   لغة جافا - الوحدة الثالثةشرح مقرر البرمجة 2   لغة جافا - الوحدة الثالثة
شرح مقرر البرمجة 2 لغة جافا - الوحدة الثالثةجامعة القدس المفتوحة
 
06 lcd slides 1 - PROCESS SYNCHRONIZATION POWERPOINT
06 lcd slides 1 - PROCESS SYNCHRONIZATION POWERPOINT06 lcd slides 1 - PROCESS SYNCHRONIZATION POWERPOINT
06 lcd slides 1 - PROCESS SYNCHRONIZATION POWERPOINTAnne Lee
 
I dont know what is wrong with this roulette program I cant seem.pdf
I dont know what is wrong with this roulette program I cant seem.pdfI dont know what is wrong with this roulette program I cant seem.pdf
I dont know what is wrong with this roulette program I cant seem.pdfarchanaemporium
 
Bti1022 lab sheet 8
Bti1022 lab sheet 8Bti1022 lab sheet 8
Bti1022 lab sheet 8alish sha
 
Microsoft Word Hw#1
Microsoft Word   Hw#1Microsoft Word   Hw#1
Microsoft Word Hw#1kkkseld
 

Ähnlich wie 2621008 - C++ 3 (20)

Ch4
Ch4Ch4
Ch4
 
Introduction to ES2015
Introduction to ES2015Introduction to ES2015
Introduction to ES2015
 
Project_Euler_No_104_Pandigital_Fibonacci_ends
Project_Euler_No_104_Pandigital_Fibonacci_endsProject_Euler_No_104_Pandigital_Fibonacci_ends
Project_Euler_No_104_Pandigital_Fibonacci_ends
 
Midterm cpp q_a_may_2014(2)
Midterm cpp q_a_may_2014(2)Midterm cpp q_a_may_2014(2)
Midterm cpp q_a_may_2014(2)
 
Cs1123 8 functions
Cs1123 8 functionsCs1123 8 functions
Cs1123 8 functions
 
how to reuse code
how to reuse codehow to reuse code
how to reuse code
 
2014 computer science_question_paper
2014 computer science_question_paper2014 computer science_question_paper
2014 computer science_question_paper
 
Lecture04
Lecture04Lecture04
Lecture04
 
C++ TUTORIAL 4
C++ TUTORIAL 4C++ TUTORIAL 4
C++ TUTORIAL 4
 
شرح مقرر البرمجة 2 لغة جافا - الوحدة الثالثة
شرح مقرر البرمجة 2   لغة جافا - الوحدة الثالثةشرح مقرر البرمجة 2   لغة جافا - الوحدة الثالثة
شرح مقرر البرمجة 2 لغة جافا - الوحدة الثالثة
 
Python 1 liners
Python 1 linersPython 1 liners
Python 1 liners
 
C++ TUTORIAL 3
C++ TUTORIAL 3C++ TUTORIAL 3
C++ TUTORIAL 3
 
06 lcd slides 1 - PROCESS SYNCHRONIZATION POWERPOINT
06 lcd slides 1 - PROCESS SYNCHRONIZATION POWERPOINT06 lcd slides 1 - PROCESS SYNCHRONIZATION POWERPOINT
06 lcd slides 1 - PROCESS SYNCHRONIZATION POWERPOINT
 
I dont know what is wrong with this roulette program I cant seem.pdf
I dont know what is wrong with this roulette program I cant seem.pdfI dont know what is wrong with this roulette program I cant seem.pdf
I dont know what is wrong with this roulette program I cant seem.pdf
 
Qno 1 (d)
Qno 1 (d)Qno 1 (d)
Qno 1 (d)
 
Bti1022 lab sheet 8
Bti1022 lab sheet 8Bti1022 lab sheet 8
Bti1022 lab sheet 8
 
Advanced pointer
Advanced pointerAdvanced pointer
Advanced pointer
 
C++20 features
C++20 features C++20 features
C++20 features
 
C# Assignmet Help
C# Assignmet HelpC# Assignmet Help
C# Assignmet Help
 
Microsoft Word Hw#1
Microsoft Word   Hw#1Microsoft Word   Hw#1
Microsoft Word Hw#1
 

Kürzlich hochgeladen

Top Rated Bangalore Call Girls Mg Road ⟟ 9332606886 ⟟ Call Me For Genuine S...
Top Rated Bangalore Call Girls Mg Road ⟟   9332606886 ⟟ Call Me For Genuine S...Top Rated Bangalore Call Girls Mg Road ⟟   9332606886 ⟟ Call Me For Genuine S...
Top Rated Bangalore Call Girls Mg Road ⟟ 9332606886 ⟟ Call Me For Genuine S...narwatsonia7
 
Call Girls Bhubaneswar Just Call 9907093804 Top Class Call Girl Service Avail...
Call Girls Bhubaneswar Just Call 9907093804 Top Class Call Girl Service Avail...Call Girls Bhubaneswar Just Call 9907093804 Top Class Call Girl Service Avail...
Call Girls Bhubaneswar Just Call 9907093804 Top Class Call Girl Service Avail...Dipal Arora
 
All Time Service Available Call Girls Marine Drive 📳 9820252231 For 18+ VIP C...
All Time Service Available Call Girls Marine Drive 📳 9820252231 For 18+ VIP C...All Time Service Available Call Girls Marine Drive 📳 9820252231 For 18+ VIP C...
All Time Service Available Call Girls Marine Drive 📳 9820252231 For 18+ VIP C...Arohi Goyal
 
Best Rate (Patna ) Call Girls Patna ⟟ 8617370543 ⟟ High Class Call Girl In 5 ...
Best Rate (Patna ) Call Girls Patna ⟟ 8617370543 ⟟ High Class Call Girl In 5 ...Best Rate (Patna ) Call Girls Patna ⟟ 8617370543 ⟟ High Class Call Girl In 5 ...
Best Rate (Patna ) Call Girls Patna ⟟ 8617370543 ⟟ High Class Call Girl In 5 ...Dipal Arora
 
Call Girls Dehradun Just Call 9907093804 Top Class Call Girl Service Available
Call Girls Dehradun Just Call 9907093804 Top Class Call Girl Service AvailableCall Girls Dehradun Just Call 9907093804 Top Class Call Girl Service Available
Call Girls Dehradun Just Call 9907093804 Top Class Call Girl Service AvailableDipal Arora
 
Top Rated Bangalore Call Girls Richmond Circle ⟟ 9332606886 ⟟ Call Me For Ge...
Top Rated Bangalore Call Girls Richmond Circle ⟟  9332606886 ⟟ Call Me For Ge...Top Rated Bangalore Call Girls Richmond Circle ⟟  9332606886 ⟟ Call Me For Ge...
Top Rated Bangalore Call Girls Richmond Circle ⟟ 9332606886 ⟟ Call Me For Ge...narwatsonia7
 
Call Girls Service Jaipur {9521753030} ❤️VVIP RIDDHI Call Girl in Jaipur Raja...
Call Girls Service Jaipur {9521753030} ❤️VVIP RIDDHI Call Girl in Jaipur Raja...Call Girls Service Jaipur {9521753030} ❤️VVIP RIDDHI Call Girl in Jaipur Raja...
Call Girls Service Jaipur {9521753030} ❤️VVIP RIDDHI Call Girl in Jaipur Raja...Sheetaleventcompany
 
Mumbai ] (Call Girls) in Mumbai 10k @ I'm VIP Independent Escorts Girls 98333...
Mumbai ] (Call Girls) in Mumbai 10k @ I'm VIP Independent Escorts Girls 98333...Mumbai ] (Call Girls) in Mumbai 10k @ I'm VIP Independent Escorts Girls 98333...
Mumbai ] (Call Girls) in Mumbai 10k @ I'm VIP Independent Escorts Girls 98333...Ishani Gupta
 
Call Girls Bangalore Just Call 8250077686 Top Class Call Girl Service Available
Call Girls Bangalore Just Call 8250077686 Top Class Call Girl Service AvailableCall Girls Bangalore Just Call 8250077686 Top Class Call Girl Service Available
Call Girls Bangalore Just Call 8250077686 Top Class Call Girl Service AvailableDipal Arora
 
Call Girls Guntur Just Call 8250077686 Top Class Call Girl Service Available
Call Girls Guntur  Just Call 8250077686 Top Class Call Girl Service AvailableCall Girls Guntur  Just Call 8250077686 Top Class Call Girl Service Available
Call Girls Guntur Just Call 8250077686 Top Class Call Girl Service AvailableDipal Arora
 
(Low Rate RASHMI ) Rate Of Call Girls Jaipur ❣ 8445551418 ❣ Elite Models & Ce...
(Low Rate RASHMI ) Rate Of Call Girls Jaipur ❣ 8445551418 ❣ Elite Models & Ce...(Low Rate RASHMI ) Rate Of Call Girls Jaipur ❣ 8445551418 ❣ Elite Models & Ce...
(Low Rate RASHMI ) Rate Of Call Girls Jaipur ❣ 8445551418 ❣ Elite Models & Ce...parulsinha
 
Pondicherry Call Girls Book Now 9630942363 Top Class Pondicherry Escort Servi...
Pondicherry Call Girls Book Now 9630942363 Top Class Pondicherry Escort Servi...Pondicherry Call Girls Book Now 9630942363 Top Class Pondicherry Escort Servi...
Pondicherry Call Girls Book Now 9630942363 Top Class Pondicherry Escort Servi...Genuine Call Girls
 
Top Rated Hyderabad Call Girls Erragadda ⟟ 9332606886 ⟟ Call Me For Genuine ...
Top Rated  Hyderabad Call Girls Erragadda ⟟ 9332606886 ⟟ Call Me For Genuine ...Top Rated  Hyderabad Call Girls Erragadda ⟟ 9332606886 ⟟ Call Me For Genuine ...
Top Rated Hyderabad Call Girls Erragadda ⟟ 9332606886 ⟟ Call Me For Genuine ...chandars293
 
Call Girls Nagpur Just Call 9907093804 Top Class Call Girl Service Available
Call Girls Nagpur Just Call 9907093804 Top Class Call Girl Service AvailableCall Girls Nagpur Just Call 9907093804 Top Class Call Girl Service Available
Call Girls Nagpur Just Call 9907093804 Top Class Call Girl Service AvailableDipal Arora
 
Call Girls Haridwar Just Call 8250077686 Top Class Call Girl Service Available
Call Girls Haridwar Just Call 8250077686 Top Class Call Girl Service AvailableCall Girls Haridwar Just Call 8250077686 Top Class Call Girl Service Available
Call Girls Haridwar Just Call 8250077686 Top Class Call Girl Service AvailableDipal Arora
 
The Most Attractive Hyderabad Call Girls Kothapet 𖠋 9332606886 𖠋 Will You Mis...
The Most Attractive Hyderabad Call Girls Kothapet 𖠋 9332606886 𖠋 Will You Mis...The Most Attractive Hyderabad Call Girls Kothapet 𖠋 9332606886 𖠋 Will You Mis...
The Most Attractive Hyderabad Call Girls Kothapet 𖠋 9332606886 𖠋 Will You Mis...chandars293
 
Premium Call Girls In Jaipur {8445551418} ❤️VVIP SEEMA Call Girl in Jaipur Ra...
Premium Call Girls In Jaipur {8445551418} ❤️VVIP SEEMA Call Girl in Jaipur Ra...Premium Call Girls In Jaipur {8445551418} ❤️VVIP SEEMA Call Girl in Jaipur Ra...
Premium Call Girls In Jaipur {8445551418} ❤️VVIP SEEMA Call Girl in Jaipur Ra...parulsinha
 
Call Girls Varanasi Just Call 8250077686 Top Class Call Girl Service Available
Call Girls Varanasi Just Call 8250077686 Top Class Call Girl Service AvailableCall Girls Varanasi Just Call 8250077686 Top Class Call Girl Service Available
Call Girls Varanasi Just Call 8250077686 Top Class Call Girl Service AvailableDipal Arora
 
Call Girls Aurangabad Just Call 8250077686 Top Class Call Girl Service Available
Call Girls Aurangabad Just Call 8250077686 Top Class Call Girl Service AvailableCall Girls Aurangabad Just Call 8250077686 Top Class Call Girl Service Available
Call Girls Aurangabad Just Call 8250077686 Top Class Call Girl Service AvailableDipal Arora
 
VIP Hyderabad Call Girls Bahadurpally 7877925207 ₹5000 To 25K With AC Room 💚😋
VIP Hyderabad Call Girls Bahadurpally 7877925207 ₹5000 To 25K With AC Room 💚😋VIP Hyderabad Call Girls Bahadurpally 7877925207 ₹5000 To 25K With AC Room 💚😋
VIP Hyderabad Call Girls Bahadurpally 7877925207 ₹5000 To 25K With AC Room 💚😋TANUJA PANDEY
 

Kürzlich hochgeladen (20)

Top Rated Bangalore Call Girls Mg Road ⟟ 9332606886 ⟟ Call Me For Genuine S...
Top Rated Bangalore Call Girls Mg Road ⟟   9332606886 ⟟ Call Me For Genuine S...Top Rated Bangalore Call Girls Mg Road ⟟   9332606886 ⟟ Call Me For Genuine S...
Top Rated Bangalore Call Girls Mg Road ⟟ 9332606886 ⟟ Call Me For Genuine S...
 
Call Girls Bhubaneswar Just Call 9907093804 Top Class Call Girl Service Avail...
Call Girls Bhubaneswar Just Call 9907093804 Top Class Call Girl Service Avail...Call Girls Bhubaneswar Just Call 9907093804 Top Class Call Girl Service Avail...
Call Girls Bhubaneswar Just Call 9907093804 Top Class Call Girl Service Avail...
 
All Time Service Available Call Girls Marine Drive 📳 9820252231 For 18+ VIP C...
All Time Service Available Call Girls Marine Drive 📳 9820252231 For 18+ VIP C...All Time Service Available Call Girls Marine Drive 📳 9820252231 For 18+ VIP C...
All Time Service Available Call Girls Marine Drive 📳 9820252231 For 18+ VIP C...
 
Best Rate (Patna ) Call Girls Patna ⟟ 8617370543 ⟟ High Class Call Girl In 5 ...
Best Rate (Patna ) Call Girls Patna ⟟ 8617370543 ⟟ High Class Call Girl In 5 ...Best Rate (Patna ) Call Girls Patna ⟟ 8617370543 ⟟ High Class Call Girl In 5 ...
Best Rate (Patna ) Call Girls Patna ⟟ 8617370543 ⟟ High Class Call Girl In 5 ...
 
Call Girls Dehradun Just Call 9907093804 Top Class Call Girl Service Available
Call Girls Dehradun Just Call 9907093804 Top Class Call Girl Service AvailableCall Girls Dehradun Just Call 9907093804 Top Class Call Girl Service Available
Call Girls Dehradun Just Call 9907093804 Top Class Call Girl Service Available
 
Top Rated Bangalore Call Girls Richmond Circle ⟟ 9332606886 ⟟ Call Me For Ge...
Top Rated Bangalore Call Girls Richmond Circle ⟟  9332606886 ⟟ Call Me For Ge...Top Rated Bangalore Call Girls Richmond Circle ⟟  9332606886 ⟟ Call Me For Ge...
Top Rated Bangalore Call Girls Richmond Circle ⟟ 9332606886 ⟟ Call Me For Ge...
 
Call Girls Service Jaipur {9521753030} ❤️VVIP RIDDHI Call Girl in Jaipur Raja...
Call Girls Service Jaipur {9521753030} ❤️VVIP RIDDHI Call Girl in Jaipur Raja...Call Girls Service Jaipur {9521753030} ❤️VVIP RIDDHI Call Girl in Jaipur Raja...
Call Girls Service Jaipur {9521753030} ❤️VVIP RIDDHI Call Girl in Jaipur Raja...
 
Mumbai ] (Call Girls) in Mumbai 10k @ I'm VIP Independent Escorts Girls 98333...
Mumbai ] (Call Girls) in Mumbai 10k @ I'm VIP Independent Escorts Girls 98333...Mumbai ] (Call Girls) in Mumbai 10k @ I'm VIP Independent Escorts Girls 98333...
Mumbai ] (Call Girls) in Mumbai 10k @ I'm VIP Independent Escorts Girls 98333...
 
Call Girls Bangalore Just Call 8250077686 Top Class Call Girl Service Available
Call Girls Bangalore Just Call 8250077686 Top Class Call Girl Service AvailableCall Girls Bangalore Just Call 8250077686 Top Class Call Girl Service Available
Call Girls Bangalore Just Call 8250077686 Top Class Call Girl Service Available
 
Call Girls Guntur Just Call 8250077686 Top Class Call Girl Service Available
Call Girls Guntur  Just Call 8250077686 Top Class Call Girl Service AvailableCall Girls Guntur  Just Call 8250077686 Top Class Call Girl Service Available
Call Girls Guntur Just Call 8250077686 Top Class Call Girl Service Available
 
(Low Rate RASHMI ) Rate Of Call Girls Jaipur ❣ 8445551418 ❣ Elite Models & Ce...
(Low Rate RASHMI ) Rate Of Call Girls Jaipur ❣ 8445551418 ❣ Elite Models & Ce...(Low Rate RASHMI ) Rate Of Call Girls Jaipur ❣ 8445551418 ❣ Elite Models & Ce...
(Low Rate RASHMI ) Rate Of Call Girls Jaipur ❣ 8445551418 ❣ Elite Models & Ce...
 
Pondicherry Call Girls Book Now 9630942363 Top Class Pondicherry Escort Servi...
Pondicherry Call Girls Book Now 9630942363 Top Class Pondicherry Escort Servi...Pondicherry Call Girls Book Now 9630942363 Top Class Pondicherry Escort Servi...
Pondicherry Call Girls Book Now 9630942363 Top Class Pondicherry Escort Servi...
 
Top Rated Hyderabad Call Girls Erragadda ⟟ 9332606886 ⟟ Call Me For Genuine ...
Top Rated  Hyderabad Call Girls Erragadda ⟟ 9332606886 ⟟ Call Me For Genuine ...Top Rated  Hyderabad Call Girls Erragadda ⟟ 9332606886 ⟟ Call Me For Genuine ...
Top Rated Hyderabad Call Girls Erragadda ⟟ 9332606886 ⟟ Call Me For Genuine ...
 
Call Girls Nagpur Just Call 9907093804 Top Class Call Girl Service Available
Call Girls Nagpur Just Call 9907093804 Top Class Call Girl Service AvailableCall Girls Nagpur Just Call 9907093804 Top Class Call Girl Service Available
Call Girls Nagpur Just Call 9907093804 Top Class Call Girl Service Available
 
Call Girls Haridwar Just Call 8250077686 Top Class Call Girl Service Available
Call Girls Haridwar Just Call 8250077686 Top Class Call Girl Service AvailableCall Girls Haridwar Just Call 8250077686 Top Class Call Girl Service Available
Call Girls Haridwar Just Call 8250077686 Top Class Call Girl Service Available
 
The Most Attractive Hyderabad Call Girls Kothapet 𖠋 9332606886 𖠋 Will You Mis...
The Most Attractive Hyderabad Call Girls Kothapet 𖠋 9332606886 𖠋 Will You Mis...The Most Attractive Hyderabad Call Girls Kothapet 𖠋 9332606886 𖠋 Will You Mis...
The Most Attractive Hyderabad Call Girls Kothapet 𖠋 9332606886 𖠋 Will You Mis...
 
Premium Call Girls In Jaipur {8445551418} ❤️VVIP SEEMA Call Girl in Jaipur Ra...
Premium Call Girls In Jaipur {8445551418} ❤️VVIP SEEMA Call Girl in Jaipur Ra...Premium Call Girls In Jaipur {8445551418} ❤️VVIP SEEMA Call Girl in Jaipur Ra...
Premium Call Girls In Jaipur {8445551418} ❤️VVIP SEEMA Call Girl in Jaipur Ra...
 
Call Girls Varanasi Just Call 8250077686 Top Class Call Girl Service Available
Call Girls Varanasi Just Call 8250077686 Top Class Call Girl Service AvailableCall Girls Varanasi Just Call 8250077686 Top Class Call Girl Service Available
Call Girls Varanasi Just Call 8250077686 Top Class Call Girl Service Available
 
Call Girls Aurangabad Just Call 8250077686 Top Class Call Girl Service Available
Call Girls Aurangabad Just Call 8250077686 Top Class Call Girl Service AvailableCall Girls Aurangabad Just Call 8250077686 Top Class Call Girl Service Available
Call Girls Aurangabad Just Call 8250077686 Top Class Call Girl Service Available
 
VIP Hyderabad Call Girls Bahadurpally 7877925207 ₹5000 To 25K With AC Room 💚😋
VIP Hyderabad Call Girls Bahadurpally 7877925207 ₹5000 To 25K With AC Room 💚😋VIP Hyderabad Call Girls Bahadurpally 7877925207 ₹5000 To 25K With AC Room 💚😋
VIP Hyderabad Call Girls Bahadurpally 7877925207 ₹5000 To 25K With AC Room 💚😋
 

2621008 - C++ 3

  • 3. Slide 3 Loop Types  Sentinel  while  do-while  Counting  for
  • 5. Slide 5 while Syntax while(test condition) { statement }
  • 6. Slide 6 When a program encounters a while loop, the test condition is evaluated first. If the condition is TRUE, the program executes the body of the loop. The program then returns to the test condition and reevaluates. If the condition is still TRUE, the body executes again. while Syntax
  • 7. Slide 7 Example #1 while (7) cout << “hello” << endl;
  • 8. Slide 8 Example #2 #include<iostream> using namespace std; int main() { int input; cout <<"enter number between 5 and 89, inclusive: "; cin >> input; while (input < 5 || input > 89) { cout << "that value is unacceptable... try again: "; cin >> input; } cout << "the value"<<input<< "is in the interval[5, 89]"<< endl; cin.get(); //system("PAUSE"); return 0; }
  • 9. Slide 9 Example #3 #include<iostream> using namespace std; int main() { long sum = 0; int counter = 1; while (counter<=100) { sum += counter; counter++ ; } cout << "sum of first 100 integers is "<< sum ; cin.get(); system("PAUSE"); return 0; }
  • 11. Copyright © 2003 Pearson Education, Inc. Slide 11 The do-while loop is similar to the while loop, except that the test condition occurs at the end of the loop. The do-while loop is an exit-condition loop. This means that the body of the loop is always executed first. Then, the test condition is evaluated. If the test condition is TRUE, the program executes the body of the loop again. If the test condition is FALSE, the loop terminates and program execution continues with the statement following the while. do-while Syntax
  • 12. Slide 12 Example #1 do{ cout << "Enter an integer between 2 and 174 (inclusive)" << "that is a multiple of 3: "; cin >> input; } while (!(input >= 2 && input <= 174 && input%3 == 0));
  • 14. Slide 14 for Syntax for (startExpression; testExpression; countExpression) } statement }
  • 15. Slide 15 • The startExpression is evaluated before the loop begins. It is acceptable to declare and assign in the startExpression(such as int x = 1;). • This startExpression is evaluated only once at the beginning of the loop. • The testExpression will evaluate to TRUE (nonzero) or FALSE (zero). While TRUE, the body of the loop repeats. When the testExpression becomes FALSE, the looping stops and the program continues with the statement immediately following the for loop body in the program code. • The countExpression executes after each trip through the loop. The count may increase/decrease by an increment of 1 or of some other value. • Braces are not required if the body of the for loop consists of only ONE statement. Please indent the body of the loop for readability. for Syntax
  • 16. Slide 16 Example #1 int max; float average; long sum = 0; short i = 0; cout << "enter positive integer: "; cin >> max; for(i=0; i <= max; i++) sum += i; average = sum/max; cout << "average is " << average << endl;
  • 17. Slide 17 Goal Output * * * * * * * * * * * * * * * Example #2
  • 18. Slide 18 Outputting 5 Lines for (int i = 1; i <= 5; i++) { cout << endl; }
  • 19. Slide 19 Outputting 5 Stars for (int i = 1; i <= 5; i++) { cout << “* ”; }
  • 20. Slide 20 Combining for (int i = 1; i <= 5; i++) { for (int j = 1; j <= 5; j++) cout << "* "; cout << endl; } output i=1 j=? variable values
  • 21. Slide 21 Combining for (int i = 1; i <= 5; i++) { for (int j = 1; j <= 5; j++) cout << "* "; cout << endl; } output i=1 j=? variable values
  • 22. Slide 22 Combining for (int i = 1; i <= 5; i++) { for (int j = 1; j <= 5; j++) cout << "* "; cout << endl; } output i=1 j=1 variable values
  • 23. Slide 23 Combining for (int i = 1; i <= 5; i++) { for (int j = 1; j <= 5; j++) cout << "* "; cout << endl; } * output i=1 j=1 variable values
  • 24. Slide 24 Combining for (int i = 1; i <= 5; i++) { for (int j = 1; j <= 5; j++) cout << "* "; cout << endl; } * output i=1 j=2 variable values
  • 25. Slide 25 Combining for (int i = 1; i <= 5; i++) { for (int j = 1; j <= 5; j++) cout << "* "; cout << endl; } * * output i=1 j=2 variable values
  • 26. Slide 26 Combining for (int i = 1; i <= 5; i++) { for (int j = 1; j <= 5; j++) cout << "* "; cout << endl; } * * output i=1 j=3 variable values
  • 27. Slide 27 Combining for (int i = 1; i <= 5; i++) { for (int j = 1; j <= 5; j++) cout << "* "; cout << endl; } * * * output i=1 j=3 variable values
  • 28. Slide 28 Combining for (int i = 1; i <= 5; i++) { for (int j = 1; j <= 5; j++) cout << "* "; cout << endl; } * * * output i=1 j=4 variable values
  • 29. Slide 29 Combining for (int i = 1; i <= 5; i++) { for (int j = 1; j <= 5; j++) cout << "* "; cout << endl; } * * * * output i=1 j=4 variable values
  • 30. Slide 30 Combining for (int i = 1; i <= 5; i++) { for (int j = 1; j <= 5; j++) cout << "* "; cout << endl; } * * * * output i=1 j=5 variable values
  • 31. Slide 31 Combining for (int i = 1; i <= 5; i++) { for (int j = 1; j <= 5; j++) cout << "* "; cout << endl; } * * * * * output i=1 j=5 variable values
  • 32. Slide 32 Combining for (int i = 1; i <= 5; i++) { for (int j = 1; j <= 5; j++) cout << "* "; cout << endl; } * * * * * output i=1 j=6 variable values
  • 33. Slide 33 Combining for (int i = 1; i <= 5; i++) { for (int j = 1; j <= 5; j++) cout << "* "; cout << endl; } * * * * * output i=1 j=6 variable values
  • 34. Slide 34 Combining for (int i = 1; i <= 5; i++) { for (int j = 1; j <= 5; j++) cout << "* "; cout << endl; } * * * * * output i=2 j=? variable values
  • 35. Slide 35 Combining for (int i = 1; i <= 5; i++) { for (int j = 1; j <= 5; j++) cout << "* "; cout << endl; } * * * * * output i=2 j=1 variable values
  • 36. Slide 36 Combining for (int i = 1; i <= 5; i++) { for (int j = 1; j <= 5; j++) cout << "* "; cout << endl; } * * * * * * output i=2 j=1 variable values
  • 37. Slide 37 Combining for (int i = 1; i <= 5; i++) { for (int j = 1; j <= 5; j++) cout << "* "; cout << endl; } * * * * * * output i=2 j=2 variable values
  • 38. Slide 38 Combining for (int i = 1; i <= 5; i++) { for (int j = 1; j <= 5; j++) cout << "* "; cout << endl; } * * * * * * * output i=2 j=2 variable values
  • 39. Slide 39 Combining for (int i = 1; i <= 5; i++) { for (int j = 1; j <= 5; j++) cout << "* "; cout << endl; } * * * * * * * output i=2 j=3 variable values
  • 40. Slide 40 Combining for (int i = 1; i <= 5; i++) { for (int j = 1; j <= 5; j++) cout << "* "; cout << endl; } * * * * * * * * output i=2 j=3 variable values
  • 41. Slide 41 Combining for (int i = 1; i <= 5; i++) { for (int j = 1; j <= 5; j++) cout << "* "; cout << endl; } * * * * * * * * output i=2 j=4 variable values
  • 42. Slide 42 Combining for (int i = 1; i <= 5; i++) { for (int j = 1; j <= 5; j++) cout << "* "; cout << endl; } * * * * * * * * * output i=2 j=4 variable values
  • 43. Combining for (int i = 1; i <= 5; i++) { for (int j = 1; j <= 5; j++) cout << "* "; cout << endl; } * * * * * * * * * output i=2 j=5 variable values
  • 44. Slide 44 Combining for (int i = 1; i <= 5; i++) { for (int j = 1; j <= 5; j++) cout << "* "; cout << endl; } * * * * * * * * * * output i=2 j=5 variable values oops!!!
  • 45. Slide 45 Goal vs Actual Goal * * * * * * * * * * * * * * * Actual * * * * * * * * * * * * * * * * * * * * * * * * * j=1 j=2 j=3 j=4 j=5 i=1 i=2 i=3 i=4 i=5
  • 46. Slide 46 Fixed for (int i=1; i <= 5; i++) { for (int j=1; j <= 5 – i + 1; j++) cout << "* "; cout << endl; } output i=1 j=? variable values
  • 47. Slide 47 Fixed for (int i=1; i <= 5; i++) { for (int j=1; j <= 5 – i + 1; j++) cout << "* "; cout << endl; } output i=1 j=1 variable values
  • 48. Slide 48 Fixed for (int i=1; i <= 5; i++) { for (int j=1; j <= 5 – i + 1; j++) cout << "* "; cout << endl; } * output i=1 j=1 variable values
  • 49. Slide 49 Fixed for (int i=1; i <= 5; i++) { for (int j=1; j <= 5 – i + 1; j++) cout << "* "; cout << endl; } * output i=1 j=2 variable values
  • 50. Slide 50 Fixed for (int i=1; i <= 5; i++) { for (int j=1; j <= 5 – i + 1; j++) cout << "* "; cout << endl; } * * output i=1 j=2 variable values
  • 51. Slide 51 Fixed for (int i=1; i <= 5; i++) { for (int j=1; j <= 5 – i + 1; j++) cout << "* "; cout << endl; } * * output i=1 j=3 variable values
  • 52. Slide 52 Fixed for (int i=1; i <= 5; i++) { for (int j=1; j <= 5 – i + 1; j++) cout << "* "; cout << endl; } * * * output i=1 j=3 variable values
  • 53. Slide 53 Fixed for (int i=1; i <= 5; i++) { for (int j=1; j <= 5 – i + 1; j++) cout << "* "; cout << endl; } * * * output i=1 j=4 variable values
  • 54. Slide 54 Fixed for (int i=1; i <= 5; i++) { for (int j=1; j <= 5 – i + 1; j++) cout << "* "; cout << endl; } * * * * output i=1 j=4 variable values
  • 55. Slide 55 Fixed for (int i=1; i <= 5; i++) { for (int j=1; j <= 5 – i + 1; j++) cout << "* "; cout << endl; } * * * * * output i=1 j=5 variable values
  • 56. Slide 56 Fixed for (int i=1; i <= 5; i++) { for (int j=1; j <= 5 – i + 1; j++) cout << "* "; cout << endl; } * * * * * output i=1 j=6 variable values
  • 57. Slide 57 Fixed for (int i=1; i <= 5; i++) { for (int j=1; j <= 5 – i + 1; j++) cout << "* "; cout << endl; } * * * * * output i=1 j=6 variable values
  • 58. Slide 58 Fixed for (int i=1; i <= 5; i++) { for (int j=1; j <= 5 – i + 1; j++) cout << "* "; cout << endl; } * * * * * output i=2 j=? variable values
  • 59. Slide 59 Fixed for (int i=1; i <= 5; i++) { for (int j=1; j <= 5 – i + 1; j++) cout << "* "; cout << endl; } * * * * * output i=2 j=1 variable values
  • 60. Slide 60 Fixed for (int i=1; i <= 5; i++) { for (int j=1; j <= 5 – i + 1; j++) cout << "* "; cout << endl; } * * * * * * output i=2 j=1 variable values
  • 61. Slide 61 Fixed for (int i=1; i <= 5; i++) { for (int j=1; j <= 5 – i + 1; j++) cout << "* "; cout << endl; } * * * * * * output i=2 j=2 variable values
  • 62. Slide 62 Fixed for (int i=1; i <= 5; i++) { for (int j=1; j <= 5 – i + 1; j++) cout << "* "; cout << endl; } * * * * * * * output i=2 j=2 variable values
  • 63. Slide 63 Fixed for (int i=1; i <= 5; i++) { for (int j=1; j <= 5 – i + 1; j++) cout << "* "; cout << endl; } * * * * * * * output i=2 j=3 variable values
  • 64. Slide 64 Fixed for (int i=1; i <= 5; i++) { for (int j=1; j <= 5 – i + 1; j++) cout << "* "; cout << endl; } * * * * * * * * output i=2 j=3 variable values
  • 65. Slide 65 Fixed for (int i=1; i <= 5; i++) { for (int j=1; j <= 5 – i + 1; j++) cout << "* "; cout << endl; } * * * * * * * * output i=2 j=4 variable values
  • 66. Slide 66 Fixed for (int i=1; i <= 5; i++) { for (int j=1; j <= 5 – i + 1; j++) cout << "* "; cout << endl; } * * * * * * * * * output i=2 j=4 variable values
  • 67. Slide 67 Fixed for (int i=1; i <= 5; i++) { for (int j=1; j <= 5 – i + 1; j++) cout << "* "; cout << endl; } * * * * * * * * * output i=2 j=5 variable values
  • 68. Slide 68 Fixed for (int i=1; i <= 5; i++) { for (int j=1; j <= 5 – i + 1; j++) cout << "* "; cout << endl; } * * * * * * * * * output i=2 j=5 variable values
  • 69. Slide 69 Fixed for (int i=1; i <= 5; i++) { for (int j=1; j <= 5 – i + 1; j++) cout << "* "; cout << endl; } * * * * * * * * * output i=3 j=? variable values
  • 70. Slide 70 Fixed for (int i=1; i <= 5; i++) { for (int j=1; j <= 5 – i + 1; j++) cout << "* "; cout << endl; } * * * * * * * * * output i=3 j=1 variable values
  • 71. Slide 71 Fixed for (int i=1; i <= 5; i++) { for (int j=1; j <= 5 – i + 1; j++) cout << "* "; cout << endl; } * * * * * * * * * * output i=3 j=1 variable values
  • 72. Slide 72 Fixed for (int i=1; i <= 5; i++) { for (int j=1; j <= 5 – i + 1; j++) cout << "* "; cout << endl; } * * * * * * * * * * output i=3 j=2 variable values
  • 73. Fixed for (int i=1; i <= 5; i++) { for (int j=1; j <= 5 – i + 1; j++) cout << "* "; cout << endl; } * * * * * * * * * * * output i=3 j=2 variable values
  • 74. Slide 74 Fixed for (int i=1; i <= 5; i++) { for (int j=1; j <= 5 – i + 1; j++) cout << "* "; cout << endl; } * * * * * * * * * * * output i=3 j=3 variable values
  • 75. Slide 75 Fixed for (int i=1; i <= 5; i++) { for (int j=1; j <= 5 – i + 1; j++) cout << "* "; cout << endl; } * * * * * * * * * * * * output i=3 j=3 variable values
  • 76. Slide 76 Fixed for (int i=1; i <= 5; i++) { for (int j=1; j <= 5 – i + 1; j++) cout << "* "; cout << endl; } * * * * * * * * * * * * output i=3 j=4 variable values
  • 77. Slide 77 Fixed for (int i=1; i <= 5; i++) { for (int j=1; j <= 5 – i + 1; j++) cout << "* "; cout << endl; } * * * * * * * * * * * * output i=3 j=4 variable values
  • 78. Slide 78 Fixed for (int i=1; i <= 5; i++) { for (int j=1; j <= 5 – i + 1; j++) cout << "* "; cout << endl; } * * * * * * * * * * * * output i=4 j=? variable values
  • 79. Slide 79 Fixed for (int i=1; i <= 5; i++) { for (int j=1; j <= 5 – i + 1; j++) cout << "* "; cout << endl; } * * * * * * * * * * * * output i=4 j=1 variable values
  • 80. Fixed for (int i=1; i <= 5; i++) { for (int j=1; j <= 5 – i + 1; j++) cout << "* "; cout << endl; } * * * * * * * * * * * * * output i=4 j=1 variable values
  • 81. Slide 81 Fixed for (int i=1; i <= 5; i++) { for (int j=1; j <= 5 – i + 1; j++) cout << "* "; cout << endl; } * * * * * * * * * * * * * output i=4 j=2 variable values
  • 82. Slide 82 Fixed for (int i=1; i <= 5; i++) { for (int j=1; j <= 5 – i + 1; j++) cout << "* "; cout << endl; } * * * * * * * * * * * * * * output i=4 j=2 variable values
  • 83. Slide 83 Fixed for (int i=1; i <= 5; i++) { for (int j=1; j <= 5 – i + 1; j++) cout << "* "; cout << endl; } * * * * * * * * * * * * * * output i=4 j=3 variable values
  • 84. Slide 84 Fixed for (int i=1; i <= 5; i++) { for (int j=1; j <= 5 – i + 1; j++) cout << "* "; cout << endl; } * * * * * * * * * * * * * * output i=4 j=3 variable values
  • 85. Slide 85 Fixed for (int i=1; i <= 5; i++) { for (int j=1; j <= 5 – i + 1; j++) cout << "* "; cout << endl; } * * * * * * * * * * * * * * output i=5 j=? variable values
  • 86. Slide 86 Fixed for (int i=1; i <= 5; i++) { for (int j=1; j <= 5 – i + 1; j++) cout << "* "; cout << endl; } * * * * * * * * * * * * * * output i=5 j=1 variable values
  • 87. Slide 87 Fixed for (int i=1; i <= 5; i++) { for (int j=1; j <= 5 – i + 1; j++) cout << "* "; cout << endl; } * * * * * * * * * * * * * * * output i=5 j=1 variable values
  • 88. Slide 88 Fixed for (int i=1; i <= 5; i++) { for (int j=1; j <= 5 – i + 1; j++) cout << "* "; cout << endl; } * * * * * * * * * * * * * * * output i=5 j=2 variable values
  • 89. Slide 89 Fixed for (int i=1; i <= 5; i++) { for (int j=1; j <= 5 – i + 1; j++) cout << "* "; cout << endl; } * * * * * * * * * * * * * * * output i=5 j=2 variable values
  • 90. Slide 90 Fixed for (int i=1; i <= 5; i++) { for (int j=1; j <= 5 – i + 1; j++) cout << "* "; cout << endl; } * * * * * * * * * * * * * * * output i=6 j=? variable values
  • 91. Slide 91 Fixed for (int i=1; i <= 5; i++) { for (int j=1; j <= 5 – i + 1; j++) cout << "* "; cout << endl; } * * * * * * * * * * * * * * * output i=6 j=? variable values
  • 92. Slide 92 * * * * * * * * * * * * * * *
  • 93. Slide 93 Solution Rows for (short i = 0; i < 5; i++) { for (short j = 1; j <= i; j++) cout << " "; for (short j = i; j < 5; j++) cout << "* "; cout << endl; } * * * * * * * * * * * * * * *
  • 94. Slide 94 Solution Spaces for (short i = 0; i < 5; i++) { for (short j = 1; j <= i; j++) cout << " "; for (short j = i; j < 5; j++) cout << "* "; cout << endl; } * * * * * * * * * * * * * * *
  • 95. Slide 95 Solution Stars for (short i = 0; i < 5; i++) { for (short j = 1; j <= i; j++) cout << " "; for (short j = i; j < 5; j++) cout << "* "; cout << endl; } * * * * * * * * * * * * * * *
  • 97. Slide 97 rand() #include <iostream> using namespace std; int main() { for(int i = 1; i <= 10; i++) cout << rand() << endl; return 0; }
  • 98. Slide 98 rand() #include <iostream> using namespace std; int main() { for(int i = 1; i <= 10; i++) cout << rand() << endl; return 0; } 38457 733887 7384 94877 243 3994452 374008 23146 11833432 237844 First Execution
  • 99. Slide 99 rand() #include <iostream> using namespace std; int main() { for(int i = 1; i <= 10; i++) cout << rand() << endl; return 0; } 38457 733887 7384 94877 243 3994452 374008 23146 11833432 237844 First Execution 38457 733887 7384 94877 243 3994452 374008 23146 11833432 237844 Second Executio
  • 100. Slide 100 Pseudo-Random Generation The numbers aren't actually random -- they're generated by a formula, so they're just pseudorandom.
  • 101. Slide 101 The pseudo-random number generator is initialized using the argument passed as seed. For every different seed value used in a call to srandsrand, the pseudo-randompseudo-random number generatornumber generator can be expected to generate a different succession of results in the subsequent calls to rand. Two different initializations with the same seed will generate the same succession of results in subsequent calls to rand. In order to generate random-like numbers, srandsrand is usually initialized to some distinctive runtime value, like the value returned by function time (declared in header <ctime><ctime>). This is distinctive enough for most trivial randomization needs.
  • 102. Slide 102 srand() #include <iostream> #include <ctime> #include <cstdlib> using namespace std; int main() { srand(time(NULL)); for(int i = 1; i <= 10; i++) cout << rand() << endl; return 0; }
  • 103. Slide 103 srand() #include <iostream> #include <ctime> #include <cstdlib> using namespace std; int main() { srand(time(NULL)); for(int i = 1; i <= 10; i++) cout << rand() << endl; return 0; } 464 53735 342 23 6578 889 93723 7165 7422457 78614 First Execution
  • 104. Slide 104 srand() #include <iostream> #include <ctime> #include <cstdlib> using namespace std; int main() { srand(time(NULL)); for(int i = 1; i <= 10; i++) cout << rand() << endl; return 0; } 464 53735 342 23 6578 889 93723 7165 7422457 78614 First Execution 6877 245768 215 57618 78511 79738 3461 175117 35 257868 Second Execution
  • 105. Slide 105 limiting range: [0, MAX_RAND] #include <iostream> #include <ctime> #include <cstdlib> using namespace std; int main() { long next_value; srand(time(NULL)); for (int i = 1; i <= 100000; i++) if (rand()%100 <= 34) cout << "hello" << endl; // ~35,000 times else cout << "goodbye" << endl; // ~65,000 times return 0; }
  • 106. Slide 106 #include <iostream> using namespace std; void main () { int x, y; double z; if(typeid(x) == typeid(y)) cout << "x and y are of same type."<<endl; else cout<< "x and y are of different type. " <<endl; cout << "The type of z is "<< typeid(z).name()<<endl; cout<< "The type of y is "<< typeid(y).name() << endl; } typeid () The expected output of the program is given below. x and y are of same type. The type of z is double The type of y is int The operator typeid () identifies the type of variable. Here we only show the use of the operator. It returns reference to type of its argument. It is coded as: typeid(object);