![]() ![]() University of Tehran Cell:Ģ Unfinished Business Casts (force an expression to be of a specific type) #include using namespace std int main() // print i and i/2 with fractions int i for(i=1 i using namespace std int main() int a, b cout > a > b if(b) cout #include // for older compilers, use using namespace std int main() int magic // magic number int guess // user's guess magic = rand() // get a random number cout > guess if (guess = magic) cout magic) cout using namespace std int main() int choice cout > choice switch(choice) case 1: cout using namespace std int main() int i Ah! break for(i=0 i #include using namespace std int main() int i // print numbers until a key is pressed for(i=0 !kbhit() i ) cout using namespace std int main() int x for(x=0 x!= 123 ) cout > x return 0 Ģ1 Time Delay Loops (the for loop is a fascinating loop) for(x=0 x 0 ) cout using namespace std int main() int x for(x=0 x using namespace std int main() int t for(t=0 t using namespace std int main() int t, count for(t=0 t using namespace std int main() int i, j for(i=2 ii/2) cout #include // for older compilers, use using namespace std void play(int m) int main() int option int magic magic = rand() do cout > option while(option3) switch(option) case 1: magic = rand() break case 2: play(magic) break case 3: cout > x if(x=m) cout << "** Right **\n" return else if(x<< "Too low.\n" else cout << "Too high.\n" cout << "You've used up all your guesses. 91 8 English German Italian Russian Services Website Design
0 Comments
Leave a Reply. |