-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindexCPP.html
1082 lines (1077 loc) · 227 KB
/
indexCPP.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>C++ Document</title>
</head>
<body>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>C++</title>
</head>
<body>
<div style="color: #6688cc; background-color: #000c18; font-family: Consolas, 'Courier New', monospace; font-weight: normal; font-size: 19px; line-height: 1.5; white-space: pre;"><span style="color: #384887;">/*author/owner :== Shyed Shahriar Housaini</span></div>
<div style="color: #6688cc; background-color: #000c18; font-family: Consolas, 'Courier New', monospace; font-weight: normal; font-size: 19px; line-height: 1.5; white-space: pre;"><span style="color: #384887;">License :== MIT + terms and conditions of author/owner</span></div>
<div style="color: #6688cc; background-color: #000c18; font-family: Consolas, 'Courier New', monospace; font-weight: normal; font-size: 19px; line-height: 1.5; white-space: pre;"><span style="color: #384887;">Copyright :== author/owner*/</span><br /><span style="color: #225588;">#include</span><span style="color: #6688cc;"> </span><span style="color: #22aa44;"><iostream></span></div>
<div style="color: #6688cc; background-color: #000c18; font-family: Consolas, 'Courier New', monospace; font-weight: normal; font-size: 19px; line-height: 1.5; white-space: pre;"><span style="color: #225588;">#include</span><span style="color: #6688cc;"> </span><span style="color: #22aa44;"><cmath></span></div>
<div style="color: #6688cc; background-color: #000c18; font-family: Consolas, 'Courier New', monospace; font-weight: normal; font-size: 19px; line-height: 1.5; white-space: pre;"><span style="color: #225588;">#include</span><span style="color: #6688cc;"> </span><span style="color: #22aa44;"><string></span></div>
<div style="color: #6688cc; background-color: #000c18; font-family: Consolas, 'Courier New', monospace; font-weight: normal; font-size: 19px; line-height: 1.5; white-space: pre;"><span style="color: #225588;">#include</span><span style="color: #6688cc;"> </span><span style="color: #22aa44;"><iomanip></span><br /><span style="color: #225588;">using</span><span style="color: #6688cc;"> </span><span style="color: #9966b8; font-style: italic;">namespace</span>
<span
style="color: #6688cc;"> </span><span style="color: #ffeebb; text-decoration: underline;">std</span><span style="color: #6688cc;">;</span><br /><span style="color: #384887;">//const float PI = 3.14f;</span><span style="color: #9966b8; font-style: italic;">int</span>
<span
style="color: #6688cc;"> </span><span style="color: #225588;">const</span><span style="color: #6688cc;"> DAYS_IN_A_WEEK </span><span style="color: #225588;">=</span><span style="color: #6688cc;"> </span><span style="color: #f280d0;">7</span>
<span
style="color: #6688cc;">;</span><span style="color: #9966b8; font-style: italic;">int</span><span style="color: #6688cc;"> </span><span style="color: #ddbb88;">main</span><span style="color: #6688cc;">(</span><span style="color: #9966b8; font-style: italic;">void</span>
<span
style="color: #6688cc;">)</span><br /><span style="color: #6688cc;">{</span><br /><span style="color: #6688cc;"> cout</span><span style="color: #225588;"><<</span><span style="color: #22aa44;">"</span><span style="color: #f280d0;">\n</span>
<span
style="color: #22aa44;"> A C++ program is a collection of commands or statements. </span><span style="color: #f280d0;">\n</span><span style="color: #22aa44;">"</span><span style="color: #225588;"><<</span><span style="color: #6688cc;">endl;</span>
<span
style="color: #f280d0;">\</span><br /><span style="color: #6688cc;"> cout</span><span style="color: #225588;"><<</span><span style="color: #22aa44;">"</span><span style="color: #f280d0;">\n</span><span style="color: #22aa44;"> </span>
<span
style="color: #f280d0;">\n</span><span style="color: #22aa44;">"</span><span style="color: #225588;"><<</span><span style="color: #6688cc;">endl;</span><span style="color: #6688cc;">cout</span><span style="color: #225588;"><<</span>
<span
style="color: #22aa44;">"</span><span style="color: #f280d0;">\n</span><span style="color: #22aa44;"> Entry point of every C++ program</span></div>
<div style="color: #6688cc; background-color: #000c18; font-family: Consolas, 'Courier New', monospace; font-weight: normal; font-size: 19px; line-height: 1.5; white-space: pre;"><span style="color: #22aa44;"> is</span></div>
<div style="color: #6688cc; background-color: #000c18; font-family: Consolas, 'Courier New', monospace; font-weight: normal; font-size: 19px; line-height: 1.5; white-space: pre;"><span style="color: #22aa44;"> the main() function, irrespective of </span><span style="color: #f280d0;">\n</span><span style="color: #22aa44;"> what *** program does. </span></div>
<div style="color: #6688cc; background-color: #000c18; font-family: Consolas, 'Courier New', monospace; font-weight: normal; font-size: 19px; line-height: 1.5; white-space: pre;"><span style="color: #22aa44;">Curly brackets { } indicate the beginning and end of a function, </span><span style="color: #f280d0;">\n</span><span style="color: #22aa44;"> </span></div>
<div style="color: #6688cc; background-color: #000c18; font-family: Consolas, 'Courier New', monospace; font-weight: normal; font-size: 19px; line-height: 1.5; white-space: pre;"><span style="color: #22aa44;"> which can also be called the function's body. The *********** inside </span></div>
<div style="color: #6688cc; background-color: #000c18; font-family: Consolas, 'Courier New', monospace; font-weight: normal; font-size: 19px; line-height: 1.5; white-space: pre;"><span style="color: #22aa44;">the brackets </span><span style="color: #f280d0;">\n</span><span style="color: #22aa44;"> indicates what the function does when executed. </span></div>
<div style="color: #6688cc; background-color: #000c18; font-family: Consolas, 'Courier New', monospace; font-weight: normal; font-size: 19px; line-height: 1.5; white-space: pre;"><span style="color: #22aa44;"> </span><span style="color: #f280d0;">\n</span><span style="color: #22aa44;">"</span><span style="color: #225588;"><<</span><span style="color: #6688cc;">endl;</span><span style="color: #6688cc;">cout</span>
<span
style="color: #225588;"><<</span><span style="color: #22aa44;">"</span><span style="color: #f280d0;">\n</span><span style="color: #22aa44;"> **** is the stream object used to perform output </span></div>
<div style="color: #6688cc; background-color: #000c18; font-family: Consolas, 'Courier New', monospace; font-weight: normal; font-size: 19px; line-height: 1.5; white-space: pre;"><span style="color: #22aa44;">on *** ******** ****** device which is usually the display screen. </span></div>
<div style="color: #6688cc; background-color: #000c18; font-family: Consolas, 'Courier New', monospace; font-weight: normal; font-size: 19px; line-height: 1.5; white-space: pre;"><span style="color: #22aa44;">**** is used in combination with the insertion operator <<. In C++,</span></div>
<div style="color: #6688cc; background-color: #000c18; font-family: Consolas, 'Courier New', monospace; font-weight: normal; font-size: 19px; line-height: 1.5; white-space: pre;"><span style="color: #22aa44;"> streams are used to perform input and output operations. </span></div>
<div style="color: #6688cc; background-color: #000c18; font-family: Consolas, 'Courier New', monospace; font-weight: normal; font-size: 19px; line-height: 1.5; white-space: pre;"><span style="color: #22aa44;"> </span><span style="color: #f280d0;">\n</span><span style="color: #22aa44;">"</span><span style="color: #225588;"><<</span><span style="color: #6688cc;">endl;</span><br /><span style="color: #6688cc;"> cout</span>
<span
style="color: #225588;"><<</span><span style="color: #22aa44;">"</span><span style="color: #f280d0;">\n</span><span style="color: #22aa44;"> #include <iostream> is a header file library that lets us </span></div>
<div style="color: #6688cc; background-color: #000c18; font-family: Consolas, 'Courier New', monospace; font-weight: normal; font-size: 19px; line-height: 1.5; white-space: pre;"><span style="color: #22aa44;">work with input and output objects, such ** cout</span></div>
<div style="color: #6688cc; background-color: #000c18; font-family: Consolas, 'Courier New', monospace; font-weight: normal; font-size: 19px; line-height: 1.5; white-space: pre;"><span style="color: #22aa44;"> ('see-out' **** in line 5). Header files *** functionality to C++ </span></div>
<div style="color: #6688cc; background-color: #000c18; font-family: Consolas, 'Courier New', monospace; font-weight: normal; font-size: 19px; line-height: 1.5; white-space: pre;"> </div>
<div style="color: #6688cc; background-color: #000c18; font-family: Consolas, 'Courier New', monospace; font-weight: normal; font-size: 19px; line-height: 1.5; white-space: pre;"><span style="color: #22aa44;">programs. C++ offers ******* headers, each ** which contains information</span></div>
<div style="color: #6688cc; background-color: #000c18; font-family: Consolas, 'Courier New', monospace; font-weight: normal; font-size: 19px; line-height: 1.5; white-space: pre;"><span style="color: #22aa44;"> needed for programs ** work properly.</span><span style="color: #f280d0;">\n</span><span style="color: #22aa44;">"</span><span style="color: #225588;"><<</span><span style="color: #6688cc;">endl;</span>
<span
style="color: #6688cc;">cout</span><span style="color: #225588;"><<</span><span style="color: #22aa44;">"</span><span style="color: #f280d0;">\n</span><span style="color: #22aa44;"> </span><span style="color: #f280d0;">\n</span>
<span
style="color: #22aa44;">"</span><span style="color: #225588;"><<</span><span style="color: #6688cc;">endl;</span></div>
<div style="color: #6688cc; background-color: #000c18; font-family: Consolas, 'Courier New', monospace; font-weight: normal; font-size: 19px; line-height: 1.5; white-space: pre;"><span style="color: #6688cc;">cout</span><span style="color: #225588;"><<</span><span style="color: #22aa44;">"</span><span style="color: #f280d0;">\n</span><span style="color: #22aa44;"> In our code, the line using ********* std; ***** the ******** </span></div>
<div style="color: #6688cc; background-color: #000c18; font-family: Consolas, 'Courier New', monospace; font-weight: normal; font-size: 19px; line-height: 1.5; white-space: pre;"><span style="color: #22aa44;">to *** the *** (standard) namespace: using namespace std means that ** </span></div>
<div style="color: #6688cc; background-color: #000c18; font-family: Consolas, 'Courier New', monospace; font-weight: normal; font-size: 19px; line-height: 1.5; white-space: pre;"><span style="color: #22aa44;">can use names for objects and variables from the standard library.</span></div>
<div style="color: #6688cc; background-color: #000c18; font-family: Consolas, 'Courier New', monospace; font-weight: normal; font-size: 19px; line-height: 1.5; white-space: pre;"><span style="color: #22aa44;"> The std ********* includes features of *** C++ Standard Library.</span><span style="color: #f280d0;">\n</span><span style="color: #22aa44;"> "</span><span style="color: #225588;"><<</span><span style="color: #6688cc;">endl;</span></div>
<div style="color: #6688cc; background-color: #000c18; font-family: Consolas, 'Courier New', monospace; font-weight: normal; font-size: 19px; line-height: 1.5; white-space: pre;"> </div>
<div style="color: #6688cc; background-color: #000c18; font-family: Consolas, 'Courier New', monospace; font-weight: normal; font-size: 19px; line-height: 1.5; white-space: pre;"><br /><span style="color: #6688cc;">cout</span><span style="color: #225588;"><<</span><span style="color: #22aa44;">"</span><span style="color: #f280d0;">\n</span><span style="color: #22aa44;"> The backslash (</span><span style="color: #f280d0;">\\</span>
<span
style="color: #22aa44;">) is called an escape character, *** indicates</span>
</div>
<div style="color: #6688cc; background-color: #000c18; font-family: Consolas, 'Courier New', monospace; font-weight: normal; font-size: 19px; line-height: 1.5; white-space: pre;"><span style="color: #22aa44;"> a 'special' character. </span><span style="color: #f280d0;">\n</span><span style="color: #22aa44;">"</span><span style="color: #225588;"><<</span><span style="color: #6688cc;">endl;</span>
<span
style="color: #6688cc;">cout</span><span style="color: #225588;"><<</span><span style="color: #22aa44;">"</span><span style="color: #f280d0;">\n</span><span style="color: #22aa44;"> The new line character </span><span style="color: #f280d0;">\\</span>
<span
style="color: #22aa44;">n</span>
</div>
<div style="color: #6688cc; background-color: #000c18; font-family: Consolas, 'Courier New', monospace; font-weight: normal; font-size: 19px; line-height: 1.5; white-space: pre;"><span style="color: #22aa44;"> can be **** as ** alternative to endl.Using a single cout statement with </span></div>
<div style="color: #6688cc; background-color: #000c18; font-family: Consolas, 'Courier New', monospace; font-weight: normal; font-size: 19px; line-height: 1.5; white-space: pre;"><span style="color: #22aa44;">as many instances of </span><span style="color: #f280d0;">\n</span><span style="color: #22aa44;"> as your program requires will print out multiple </span></div>
<div style="color: #6688cc; background-color: #000c18; font-family: Consolas, 'Courier New', monospace; font-weight: normal; font-size: 19px; line-height: 1.5; white-space: pre;"><span style="color: #22aa44;">lines of text. </span><span style="color: #f280d0;">\n</span><span style="color: #22aa44;">"</span><span style="color: #225588;"><<</span><span style="color: #6688cc;">endl;</span><br /><span style="color: #6688cc;">cout</span>
<span
style="color: #225588;"><<</span><span style="color: #22aa44;">"</span><span style="color: #f280d0;">\n</span><span style="color: #22aa44;"> The cout object does not insert a line break at *** end of the</span></div>
<div style="color: #6688cc; background-color: #000c18; font-family: Consolas, 'Courier New', monospace; font-weight: normal; font-size: 19px; line-height: 1.5; white-space: pre;"><span style="color: #22aa44;"> output. One way to ***** two lines is to use the endl manipulator,</span></div>
<div style="color: #6688cc; background-color: #000c18; font-family: Consolas, 'Courier New', monospace; font-weight: normal; font-size: 19px; line-height: 1.5; white-space: pre;"><span style="color: #22aa44;"> which will put ** a line break. </span><span style="color: #f280d0;">\n</span><span style="color: #22aa44;">"</span><span style="color: #225588;"><<</span><span style="color: #6688cc;">endl;</span><br
/><span style="color: #6688cc;">cout</span><span style="color: #225588;"><<</span><span style="color: #22aa44;">"</span><span style="color: #f280d0;">\n</span><span style="color: #22aa44;"> in C++ int data types are ***** size, 4 bytes, 32 bits *** </span></div>
<div style="color: #6688cc; background-color: #000c18; font-family: Consolas, 'Courier New', monospace; font-weight: normal; font-size: 19px; line-height: 1.5; white-space: pre;"><span style="color: #22aa44;">numbers are *********** in 2's complement method.</span></div>
<div style="color: #6688cc; background-color: #000c18; font-family: Consolas, 'Courier New', monospace; font-weight: normal; font-size: 19px; line-height: 1.5; white-space: pre;"><span style="color: #22aa44;"> 6 is 00000000 00000000 00000000 00000110 and -6 </span></div>
<div style="color: #6688cc; background-color: #000c18; font-family: Consolas, 'Courier New', monospace; font-weight: normal; font-size: 19px; line-height: 1.5; white-space: pre;"><span style="color: #22aa44;">is 11111111 11111111 11111111 11111010 </span><span style="color: #f280d0;">\n</span><span style="color: #22aa44;">"</span><span style="color: #6688cc;"> </span><span style="color: #225588;"><<</span>
<span
style="color: #6688cc;">endl;</span>
</div>
<div style="color: #6688cc; background-color: #000c18; font-family: Consolas, 'Courier New', monospace; font-weight: normal; font-size: 19px; line-height: 1.5; white-space: pre;"><span style="color: #6688cc;">cout</span><span style="color: #225588;"><<</span><span style="color: #22aa44;">"</span><span style="color: #f280d0;">\n</span><span style="color: #22aa44;"> Basic Data Types: </span><span style="color: #f280d0;">\n</span>
<span
style="color: #22aa44;">"</span><span style="color: #225588;"><<</span><span style="color: #6688cc;">endl;</span></div>
<div style="color: #6688cc; background-color: #000c18; font-family: Consolas, 'Courier New', monospace; font-weight: normal; font-size: 19px; line-height: 1.5; white-space: pre;"><span style="color: #6688cc;">cout</span><span style="color: #225588;"><<</span><span style="color: #22aa44;">"</span><span style="color: #f280d0;">\n</span><span style="color: #22aa44;"> The data type specifies the size and type of information the</span></div>
<div style="color: #6688cc; background-color: #000c18; font-family: Consolas, 'Courier New', monospace; font-weight: normal; font-size: 19px; line-height: 1.5; white-space: pre;"><span style="color: #22aa44;"> variable will store: Data Type Size Description. </span><span style="color: #f280d0;">\n</span><span style="color: #22aa44;">"</span><span style="color: #225588;"><<</span><span style="color: #6688cc;">endl;</span></div>
<div style="color: #6688cc; background-color: #000c18; font-family: Consolas, 'Courier New', monospace; font-weight: normal; font-size: 19px; line-height: 1.5; white-space: pre;"><span style="color: #6688cc;">cout</span><span style="color: #225588;"><<</span><span style="color: #22aa44;">"</span><span style="color: #f280d0;">\n</span><span style="color: #22aa44;"> int 4 bytes Stores whole numbers, without decimals </span>
<span
style="color: #f280d0;">\n</span><span style="color: #22aa44;">"</span><span style="color: #225588;"><<</span><span style="color: #6688cc;">endl;</span></div>
<div style="color: #6688cc; background-color: #000c18; font-family: Consolas, 'Courier New', monospace; font-weight: normal; font-size: 19px; line-height: 1.5; white-space: pre;"><span style="color: #6688cc;">cout</span><span style="color: #225588;"><<</span><span style="color: #22aa44;">"</span><span style="color: #f280d0;">\n</span><span style="color: #22aa44;"> float 4 bytes Stores fractional numbers, containing one or</span></div>
<div style="color: #6688cc; background-color: #000c18; font-family: Consolas, 'Courier New', monospace; font-weight: normal; font-size: 19px; line-height: 1.5; white-space: pre;"><span style="color: #22aa44;"> more decimals. Sufficient for storing 7 decimal digits </span><span style="color: #f280d0;">\n</span><span style="color: #22aa44;">"</span><span style="color: #225588;"><<</span><span style="color: #6688cc;">endl;</span></div>
<div style="color: #6688cc; background-color: #000c18; font-family: Consolas, 'Courier New', monospace; font-weight: normal; font-size: 19px; line-height: 1.5; white-space: pre;"><span style="color: #6688cc;">cout</span><span style="color: #225588;"><<</span><span style="color: #22aa44;">"</span><span style="color: #f280d0;">\n</span><span style="color: #22aa44;"> double 8 ***** Stores fractional numbers, ********** one</span></div>
<div style="color: #6688cc; background-color: #000c18; font-family: Consolas, 'Courier New', monospace; font-weight: normal; font-size: 19px; line-height: 1.5; white-space: pre;"><span style="color: #22aa44;"> or more decimals. Sufficient for storing 15 decimal digits </span><span style="color: #f280d0;">\n</span><span style="color: #22aa44;">"</span><span style="color: #225588;"><<</span><span style="color: #6688cc;">endl;</span></div>
<div style="color: #6688cc; background-color: #000c18; font-family: Consolas, 'Courier New', monospace; font-weight: normal; font-size: 19px; line-height: 1.5; white-space: pre;"><span style="color: #6688cc;">cout</span><span style="color: #225588;"><<</span><span style="color: #22aa44;">"</span><span style="color: #f280d0;">\n</span><span style="color: #22aa44;"> boolean 1 byte Stores true or false values </span>
<span
style="color: #f280d0;">\n</span><span style="color: #22aa44;">"</span><span style="color: #225588;"><<</span><span style="color: #6688cc;">endl;</span></div>
<div style="color: #6688cc; background-color: #000c18; font-family: Consolas, 'Courier New', monospace; font-weight: normal; font-size: 19px; line-height: 1.5; white-space: pre;"><span style="color: #6688cc;">cout</span><span style="color: #225588;"><<</span><span style="color: #22aa44;">"</span><span style="color: #f280d0;">\n</span><span style="color: #22aa44;"> char 1 **** Stores a ****** character/letter/number, </span></div>
<div style="color: #6688cc; background-color: #000c18; font-family: Consolas, 'Courier New', monospace; font-weight: normal; font-size: 19px; line-height: 1.5; white-space: pre;"><span style="color: #22aa44;">or ASCII values </span><span style="color: #f280d0;">\n</span><span style="color: #22aa44;">"</span><span style="color: #225588;"><<</span><span style="color: #6688cc;">endl;</span><br />
<span
style="color: #6688cc;">cout</span><span style="color: #225588;"><<</span><span style="color: #22aa44;">"</span><span style="color: #f280d0;">\n</span><span style="color: #22aa44;"> String Types:-The string type ** used to store a ******** of </span></div>
<div style="color: #6688cc; background-color: #000c18; font-family: Consolas, 'Courier New', monospace; font-weight: normal; font-size: 19px; line-height: 1.5; white-space: pre;"><span style="color: #22aa44;">characters (text). This is not a built-** type, but ** behaves like one </span></div>
<div style="color: #6688cc; background-color: #000c18; font-family: Consolas, 'Courier New', monospace; font-weight: normal; font-size: 19px; line-height: 1.5; white-space: pre;"><span style="color: #22aa44;">in its most basic usage. String values must ** surrounded by double </span></div>
<div style="color: #6688cc; background-color: #000c18; font-family: Consolas, 'Courier New', monospace; font-weight: normal; font-size: 19px; line-height: 1.5; white-space: pre;"><span style="color: #22aa44;">quotes: Example - string greeting = "</span><span style="color: #6688cc;">Hello</span><span style="color: #22aa44;">";cout << greeting; </span><span style="color: #f280d0;">\n</span><span style="color: #22aa44;">"</span>
<span
style="color: #225588;"><<</span><span style="color: #6688cc;">endl;</span></div>
<div style="color: #6688cc; background-color: #000c18; font-family: Consolas, 'Courier New', monospace; font-weight: normal; font-size: 19px; line-height: 1.5; white-space: pre;"><span style="color: #6688cc;">cout</span><span style="color: #225588;"><<</span><span style="color: #22aa44;">"</span><span style="color: #f280d0;">\n</span><span style="color: #22aa44;"> To use strings, you **** ******* ** ********** header file</span></div>
<div style="color: #6688cc; background-color: #000c18; font-family: Consolas, 'Courier New', monospace; font-weight: normal; font-size: 19px; line-height: 1.5; white-space: pre;"><span style="color: #22aa44;"> in the source code, *** <string> library: </span><span style="color: #f280d0;">\n</span><span style="color: #22aa44;">"</span><span style="color: #225588;"><<</span><span style="color: #6688cc;">endl;</span></div>
<div style="color: #6688cc; background-color: #000c18; font-family: Consolas, 'Courier New', monospace; font-weight: normal; font-size: 19px; line-height: 1.5; white-space: pre;"><span style="color: #6688cc;">cout</span><span style="color: #225588;"><<</span><span style="color: #22aa44;">"</span><span style="color: #f280d0;">\n</span><span style="color: #22aa44;"> </span><span style="color: #22aa44;"> // Include *** string library #include <string> //</span></div>
<div style="color: #6688cc; background-color: #000c18; font-family: Consolas, 'Courier New', monospace; font-weight: normal; font-size: 19px; line-height: 1.5; white-space: pre;"><span style="color: #22aa44;"> Create a string variable</span><span style="color: #22aa44;">string greeting = "</span><span style="color: #6688cc;">Hello</span><span style="color: #22aa44;">";// Output string value</span></div>
<div style="color: #6688cc; background-color: #000c18; font-family: Consolas, 'Courier New', monospace; font-weight: normal; font-size: 19px; line-height: 1.5; white-space: pre;"><span style="color: #22aa44;"> cout << greeting; </span><span style="color: #f280d0;">\n</span><span style="color: #22aa44;">"</span><span style="color: #225588;"><<</span><span style="color: #6688cc;">endl;</span>
<span
style="color: #6688cc;">string greeting </span><span style="color: #225588;">=</span><span style="color: #6688cc;"> </span><span style="color: #22aa44;">"Hello"</span><span style="color: #6688cc;">;</span><span style="color: #6688cc;">cout </span>
<span
style="color: #225588;"><<</span><span style="color: #6688cc;"> greeting</span><span style="color: #225588;"><<</span><span style="color: #6688cc;">endl;</span><span style="color: #384887;">// Include the string library</span>
<span
style="color: #225588;">#include</span><span style="color: #6688cc;"> </span><span style="color: #22aa44;"><string></span><br /><span style="color: #384887;">// Create a string variable</span><span style="color: #6688cc;">string greeting </span>
<span
style="color: #225588;">=</span><span style="color: #6688cc;"> </span><span style="color: #22aa44;">"Hello"</span><span style="color: #6688cc;">;</span><br /><span style="color: #384887;">// Output string value</span><span style="color: #6688cc;">cout </span>
<span
style="color: #225588;"><<</span><span style="color: #6688cc;"> greeting</span><span style="color: #225588;"><<</span><span style="color: #6688cc;">endl;</span><br /><span style="color: #6688cc;"> </span><span style="color: #9966b8; font-style: italic;">int</span>
<span
style="color: #6688cc;"> num1, num2, num3;</span><span style="color: #6688cc;"> </span><span style="color: #9966b8; font-style: italic;">int</span><span style="color: #6688cc;"> sum;</span><br /><span style="color: #6688cc;"> cout</span>
<span
style="color: #225588;"><<</span><span style="color: #22aa44;">"Please enter three numbers for sum.</span><span style="color: #f280d0;">\n</span><span style="color: #22aa44;">"</span><span style="color: #6688cc;">;</span>
<span
style="color: #384887;"> /// Line *** ended.</span><br /><span style="color: #6688cc;"> cout</span><span style="color: #225588;"><<</span><span style="color: #22aa44;">"Please enter three numbers separated by space :</span>
<span
style="color: #f280d0;">\n</span><span style="color: #22aa44;">"</span><span style="color: #225588;"><<</span><span style="color: #6688cc;">endl;</span><span style="color: #384887;"> </span></div>
<div style="color: #6688cc; background-color: #000c18; font-family: Consolas, 'Courier New', monospace; font-weight: normal; font-size: 19px; line-height: 1.5; white-space: pre;"><span style="color: #384887;">/// Line ends.</span><br /><span style="color: #6688cc;"> cin</span><span style="color: #225588;">>></span><span style="color: #6688cc;">num1</span><span style="color: #225588;">>></span>
<span
style="color: #6688cc;">num2;</span><span style="color: #6688cc;"> cin</span><span style="color: #225588;">>></span><span style="color: #6688cc;">num3;</span><span style="color: #6688cc;"> sum </span><span style="color: #225588;">=</span>
<span
style="color: #6688cc;"> num1 </span><span style="color: #225588;">+</span><span style="color: #6688cc;"> num2 </span><span style="color: #225588;">+</span><span style="color: #6688cc;"> num3;</span><br /><span style="color: #6688cc;"> cout</span>
<span
style="color: #225588;"><<</span><span style="color: #22aa44;">"num1 + num2 + num3 = sum"</span><span style="color: #225588;"><<</span><span style="color: #6688cc;">endl;</span><br /><span style="color: #6688cc;"> cout</span>
<span
style="color: #225588;"><<</span><span style="color: #6688cc;">num1</span><span style="color: #225588;"><<</span><span style="color: #22aa44;">" + "</span><span style="color: #225588;"><<</span><span style="color: #6688cc;">num2</span>
<span
style="color: #225588;"><<</span><span style="color: #22aa44;">" + "</span><span style="color: #6688cc;"> </span><span style="color: #225588;"><<</span><span style="color: #6688cc;"> num3</span><span style="color: #225588;"><<</span>
<span
style="color: #6688cc;"> </span><span style="color: #22aa44;">" = "</span><span style="color: #225588;"><<</span><span style="color: #6688cc;">sum</span><span style="color: #225588;"><<</span><span style="color: #6688cc;">endl;</span><br
/><span style="color: #6688cc;"> cout </span><span style="color: #225588;"><<</span><span style="color: #6688cc;">num1;</span><br /><span style="color: #6688cc;"> </span>
<span
style="color: #9966b8; font-style: italic;">int</span><span style="color: #6688cc;"> num </span><span style="color: #225588;">=</span><span style="color: #6688cc;"> </span><span style="color: #f280d0;">3</span><span style="color: #6688cc;">;</span><br
/><span style="color: #6688cc;"> cout </span><span style="color: #225588;"><<</span><span style="color: #6688cc;"> </span><span style="color: #22aa44;">"Hello World! </span>
<span
style="color: #f280d0;">\n</span><span style="color: #22aa44;">"</span><span style="color: #6688cc;">;</span><br /><span style="color: #6688cc;"> cout </span><span style="color: #225588;"><<</span><span style="color: #6688cc;"> </span>
<span
style="color: #22aa44;">"***** World! </span><span style="color: #f280d0;">\n</span><span style="color: #22aa44;">"</span><span style="color: #6688cc;">;</span><span style="color: #6688cc;"> cout </span><span style="color: #225588;"><<</span>
<span
style="color: #6688cc;"> </span><span style="color: #22aa44;">"</span><span style="color: #f280d0;">\\</span><span style="color: #22aa44;">n characters after each</span></div>
<div style="color: #6688cc; background-color: #000c18; font-family: Consolas, 'Courier New', monospace; font-weight: normal; font-size: 19px; line-height: 1.5; white-space: pre;"><span style="color: #22aa44;"> other</span></div>
<div style="color: #6688cc; background-color: #000c18; font-family: Consolas, 'Courier New', monospace; font-weight: normal; font-size: 19px; line-height: 1.5; white-space: pre;"><span style="color: #22aa44;"> will create a blank line: </span><span style="color: #f280d0;">\n</span><span style="color: #22aa44;">"</span><span style="color: #6688cc;">;</span><span style="color: #6688cc;"> cout </span>
<span
style="color: #225588;"><<</span><span style="color: #6688cc;"> </span><span style="color: #22aa44;">"Hello World!"</span><span style="color: #225588;"><<</span><span style="color: #6688cc;">endl;</span></div>
<div style="color: #6688cc; background-color: #000c18; font-family: Consolas, 'Courier New', monospace; font-weight: normal; font-size: 19px; line-height: 1.5; white-space: pre;"><span style="color: #384887;"> /// Another way ** insert a *** line, is with the endl manipulator:</span><br /><span style="color: #6688cc;">cout </span><span style="color: #225588;"><<</span><span style="color: #6688cc;"> </span>
<span
style="color: #22aa44;">"Both </span><span style="color: #f280d0;">\\</span><span style="color: #22aa44;">n and endl are used to break lines. However, </span><span style="color: #f280d0;">\\</span><span style="color: #22aa44;">n is used more often and is the preferred way."</span>
<span
style="color: #225588;"><<</span><span style="color: #6688cc;">endl;</span><br /><br /><span style="color: #384887;"> ///</span><br /><span style="color: #6688cc;"> cout </span><span style="color: #225588;"><<</span><span style="color: #6688cc;"> num</span>
<span
style="color: #225588;"><<</span><span style="color: #6688cc;">endl;</span><span style="color: #6688cc;"> cout </span><span style="color: #225588;"><<</span><span style="color: #6688cc;"> </span><span style="color: #22aa44;">"num!"</span>
<span
style="color: #225588;"><<</span><span style="color: #6688cc;">endl;</span><span style="color: #6688cc;"> cout </span><span style="color: #225588;"><<</span><span style="color: #6688cc;"> </span><span style="color: #22aa44;">"3"</span>
<span
style="color: #225588;"><<</span><span style="color: #6688cc;">endl;</span><span style="color: #6688cc;"> </span></div>
<div style="color: #6688cc; background-color: #000c18; font-family: Consolas, 'Courier New', monospace; font-weight: normal; font-size: 19px; line-height: 1.5; white-space: pre;"><span style="color: #6688cc;"> cout </span><span style="color: #225588;"><<</span><span style="color: #6688cc;"> </span><span style="color: #f280d0;">3</span><span style="color: #6688cc;"> </span><span style="color: #225588;"><<</span>
<span
style="color: #6688cc;">endl;</span><br /><br /><span style="color: #6688cc;">cout</span><span style="color: #225588;"><<</span><span style="color: #22aa44;">"</span><span style="color: #f280d0;">\n</span><span style="color: #22aa44;"> ****** comments to **** code ** a **** practice.</span></div>
<div style="color: #6688cc; background-color: #000c18; font-family: Consolas, 'Courier New', monospace; font-weight: normal; font-size: 19px; line-height: 1.5; white-space: pre;"><span style="color: #22aa44;"> ** facilitates a clear understanding of the code *** *** and for others</span></div>
<div style="color: #6688cc; background-color: #000c18; font-family: Consolas, 'Courier New', monospace; font-weight: normal; font-size: 19px; line-height: 1.5; white-space: pre;"><span style="color: #22aa44;"> who read it. </span><span style="color: #f280d0;">\n</span><span style="color: #22aa44;">"</span><span style="color: #225588;"><<</span><span style="color: #6688cc;">endl;</span><br /><span style="color: #6688cc;">cout </span>
<span
style="color: #225588;"><<</span><span style="color: #6688cc;"> </span><span style="color: #22aa44;">"Single or multi-line comments? </span><span style="color: #f280d0;">\n</span><span style="color: #22aa44;">"</span><span style="color: #6688cc;">;</span>
<span
style="color: #6688cc;">cout </span><span style="color: #225588;"><<</span><span style="color: #6688cc;"> </span><span style="color: #22aa44;">"It is up to you which</span></div>
<div style="color: #6688cc; background-color: #000c18; font-family: Consolas, 'Courier New', monospace; font-weight: normal; font-size: 19px; line-height: 1.5; white-space: pre;"><span style="color: #22aa44;"> you want to use.</span><span style="color: #f280d0;">\n</span><span style="color: #22aa44;"> "</span><span style="color: #6688cc;">;</span><span style="color: #6688cc;">cout </span>
<span
style="color: #225588;"><<</span><span style="color: #6688cc;"> </span><span style="color: #22aa44;">"Normally, we use // or /// for short comments</span></div>
<div style="color: #6688cc; background-color: #000c18; font-family: Consolas, 'Courier New', monospace; font-weight: normal; font-size: 19px; line-height: 1.5; white-space: pre;"><span style="color: #22aa44;">, and /* */ for longer.</span><span style="color: #f280d0;">\n</span><span style="color: #22aa44;">"</span><span style="color: #225588;"><<</span><span style="color: #6688cc;">endl;</span><br
/><span style="color: #6688cc;">cout </span><span style="color: #225588;"><<</span><span style="color: #6688cc;"> </span><span style="color: #22aa44;">"</span><span style="color: #f280d0;">\n</span><span style="color: #22aa44;"> This "</span>
<span
style="color: #6688cc;"> </span><span style="color: #225588;"><<</span><span style="color: #6688cc;"> </span><span style="color: #22aa44;">"is "</span><span style="color: #6688cc;"> </span><span style="color: #225588;"><<</span>
<span
style="color: #6688cc;"> </span><span style="color: #22aa44;">"awesome!</span><span style="color: #f280d0;">\n</span><span style="color: #22aa44;"> "</span><span style="color: #6688cc;">;</span><br /><br /><span style="color: #6688cc;"> cout</span>
<span
style="color: #225588;"><<</span><span style="color: #22aa44;">"</span><span style="color: #f280d0;">\n</span><span style="color: #22aa44;"> ** C++ int data types *** ***** size, 4 bytes, 32 bits </span></div>
<div style="color: #6688cc; background-color: #000c18; font-family: Consolas, 'Courier New', monospace; font-weight: normal; font-size: 19px; line-height: 1.5; white-space: pre;"><span style="color: #22aa44;">*** numbers are represented in 2's complement method. </span></div>
<div style="color: #6688cc; background-color: #000c18; font-family: Consolas, 'Courier New', monospace; font-weight: normal; font-size: 19px; line-height: 1.5; white-space: pre;"><span style="color: #22aa44;">6 is 00000000 00000000 00000000 ******** and </span></div>
<div style="color: #6688cc; background-color: #000c18; font-family: Consolas, 'Courier New', monospace; font-weight: normal; font-size: 19px; line-height: 1.5; white-space: pre;"><span style="color: #22aa44;">-6 is 11111111 11111111 ******** 11111010 </span><span style="color: #f280d0;">\n</span><span style="color: #22aa44;">"</span><span style="color: #6688cc;"> </span><span style="color: #225588;"><<</span>
<span
style="color: #6688cc;">endl;</span><br /><span style="color: #6688cc;">cout</span><span style="color: #225588;"><<</span><span style="color: #22aa44;">"</span><span style="color: #f280d0;">\n</span><span style="color: #22aa44;"> Forms of Data are Variables and Variables. </span></div>
<div style="color: #6688cc; background-color: #000c18; font-family: Consolas, 'Courier New', monospace; font-weight: normal; font-size: 19px; line-height: 1.5; white-space: pre;"><span style="color: #22aa44;">C++ has two type of Constants :- Programmar Defined Constant </span></div>
<div style="color: #6688cc; background-color: #000c18; font-family: Consolas, 'Courier New', monospace; font-weight: normal; font-size: 19px; line-height: 1.5; white-space: pre;"><span style="color: #22aa44;">(const int NUM = 5) *** C++ Literals (Built into *** language, </span></div>
<div style="color: #6688cc; background-color: #000c18; font-family: Consolas, 'Courier New', monospace; font-weight: normal; font-size: 19px; line-height: 1.5; white-space: pre;"><span style="color: #22aa44;">ie- 8, 6, -6, abc, 3654 etc) </span><span style="color: #f280d0;">\n</span><span style="color: #22aa44;">"</span><span style="color: #225588;"><<</span><span style="color: #6688cc;">endl;</span><br
/><span style="color: #6688cc;">cout</span><span style="color: #225588;"><<</span><span style="color: #22aa44;">"</span><span style="color: #f280d0;">\n</span><span style="color: #22aa44;"> Arithmetic Operators :- plus +, ***** - , multiply * , </span></div>
<div style="color: #6688cc; background-color: #000c18; font-family: Consolas, 'Courier New', monospace; font-weight: normal; font-size: 19px; line-height: 1.5; white-space: pre;"><span style="color: #22aa44;">*** / , mod % , assign = "</span><span style="color: #225588;"><<</span><span style="color: #6688cc;">endl;</span><span style="color: #9966b8; font-style: italic;">int</span><span style="color: #6688cc;"> xx22 </span>
<span
style="color: #225588;">=</span><span style="color: #6688cc;"> </span><span style="color: #f280d0;">8</span><span style="color: #6688cc;">;</span><span style="color: #9966b8; font-style: italic;">int</span><span style="color: #6688cc;"> yy </span>
<span
style="color: #225588;">=</span><span style="color: #6688cc;"> (xx22 </span><span style="color: #225588;">=</span><span style="color: #6688cc;"> </span><span style="color: #f280d0;">7</span><span style="color: #6688cc;">);</span></div>
<div style="color: #6688cc; background-color: #000c18; font-family: Consolas, 'Courier New', monospace; font-weight: normal; font-size: 19px; line-height: 1.5; white-space: pre;"><span style="color: #6688cc;">cout</span><span style="color: #225588;"><<</span><span style="color: #22aa44;">"</span><span style="color: #f280d0;">\n</span><span style="color: #22aa44;"> when int xx22 = 8 </span>
<span
style="color: #f280d0;">\n</span><span style="color: #22aa44;">"</span><span style="color: #225588;"><<</span><span style="color: #6688cc;">endl;</span></div>
<div style="color: #6688cc; background-color: #000c18; font-family: Consolas, 'Courier New', monospace; font-weight: normal; font-size: 19px; line-height: 1.5; white-space: pre;"><span style="color: #6688cc;">cout</span><span style="color: #225588;"><<</span><span style="color: #22aa44;">" xx22 = "</span><span style="color: #225588;"><<</span><span style="color: #6688cc;"> xx22 </span>
<span
style="color: #225588;"><<</span><span style="color: #6688cc;">endl;</span></div>
<div style="color: #6688cc; background-color: #000c18; font-family: Consolas, 'Courier New', monospace; font-weight: normal; font-size: 19px; line-height: 1.5; white-space: pre;"><span style="color: #6688cc;">cout</span><span style="color: #225588;"><<</span><span style="color: #6688cc;"> </span><span style="color: #22aa44;">"when yy = (xx22 = 7) "</span><span style="color: #6688cc;"> </span>
<span
style="color: #225588;"><<</span><span style="color: #6688cc;">endl;</span></div>
<div style="color: #6688cc; background-color: #000c18; font-family: Consolas, 'Courier New', monospace; font-weight: normal; font-size: 19px; line-height: 1.5; white-space: pre;"><span style="color: #6688cc;">cout</span><span style="color: #225588;"><<</span><span style="color: #22aa44;">"yy= "</span><span style="color: #225588;"><<</span><span style="color: #6688cc;">yy</span><span style="color: #225588;"><<</span>
<span
style="color: #6688cc;">endl;</span><br /><span style="color: #9966b8; font-style: italic;">int</span><span style="color: #6688cc;"> DaysofTravel;</span><span style="color: #9966b8; font-style: italic;">int</span><span style="color: #6688cc;"> fullWeeks, daysRemaining;</span></div>
<div style="color: #6688cc; background-color: #000c18; font-family: Consolas, 'Courier New', monospace; font-weight: normal; font-size: 19px; line-height: 1.5; white-space: pre;"><span style="color: #6688cc;">cout</span><span style="color: #225588;"><<</span><span style="color: #22aa44;">"</span><span style="color: #f280d0;">\n</span><span style="color: #22aa44;"> ****** enter the ****** of **** you have ********* : </span>
<span
style="color: #f280d0;">\n</span><span style="color: #22aa44;">"</span><span style="color: #225588;"><<</span><span style="color: #6688cc;">endl;</span></div>
<div style="color: #6688cc; background-color: #000c18; font-family: Consolas, 'Courier New', monospace; font-weight: normal; font-size: 19px; line-height: 1.5; white-space: pre;"><span style="color: #6688cc;">cin</span><span style="color: #225588;">>></span><span style="color: #6688cc;">DaysofTravel;</span><br /><span style="color: #6688cc;">fullWeeks </span><span style="color: #225588;">=</span><span style="color: #6688cc;"> DaysofTravel</span>
<span
style="color: #225588;">/</span><span style="color: #6688cc;"> DAYS_IN_A_WEEK;</span></div>
<div style="color: #6688cc; background-color: #000c18; font-family: Consolas, 'Courier New', monospace; font-weight: normal; font-size: 19px; line-height: 1.5; white-space: pre;"><span style="color: #6688cc;">daysRemaining </span><span style="color: #225588;">=</span><span style="color: #6688cc;"> DaysofTravel</span><span style="color: #225588;">%</span><span style="color: #6688cc;">DAYS_IN_A_WEEK;</span><br
/><span style="color: #6688cc;">cout</span><span style="color: #225588;"><<</span><span style="color: #6688cc;"> DaysofTravel </span><span style="color: #225588;"><<</span><span style="color: #6688cc;"> </span>
<span
style="color: #22aa44;">" days are "</span><span style="color: #225588;"><<</span><span style="color: #6688cc;"> fullWeeks</span><span style="color: #225588;"><<</span><span style="color: #22aa44;">" weeks and "</span>
<span
style="color: #225588;"><<</span><span style="color: #6688cc;"> daysRemaining</span><span style="color: #225588;"><<</span><span style="color: #6688cc;"> </span><span style="color: #22aa44;">" days "</span><span style="color: #225588;"><<</span>
<span
style="color: #6688cc;">endl;</span><br /><span style="color: #6688cc;">cout</span><span style="color: #225588;"><<</span><span style="color: #22aa44;">"</span><span style="color: #f280d0;">\n</span><span style="color: #22aa44;"> **** type of float or double are real numbers or ********** or </span></div>
<div style="color: #6688cc; background-color: #000c18; font-family: Consolas, 'Courier New', monospace; font-weight: normal; font-size: 19px; line-height: 1.5; white-space: pre;"><span style="color: #22aa44;">decimal numbers </span><span style="color: #f280d0;">\n</span><span style="color: #22aa44;">"</span><span style="color: #225588;"><<</span><span style="color: #6688cc;">endl;</span><span style="color: #6688cc;">cout</span>
<span
style="color: #225588;"><<</span><span style="color: #22aa44;">"</span><span style="color: #f280d0;">\n</span><span style="color: #22aa44;"> float have **** of 4 bytes or 32 bits,</span></div>
<div style="color: #6688cc; background-color: #000c18; font-family: Consolas, 'Courier New', monospace; font-weight: normal; font-size: 19px; line-height: 1.5; white-space: pre;"><span style="color: #22aa44;"> double has size of 8 bytes or 64 bits </span><span style="color: #f280d0;">\n</span><span style="color: #22aa44;">"</span><span style="color: #225588;"><<</span><span style="color: #6688cc;">endl;</span></div>
<div style="color: #6688cc; background-color: #000c18; font-family: Consolas, 'Courier New', monospace; font-weight: normal; font-size: 19px; line-height: 1.5; white-space: pre;"><span style="color: #6688cc;">cout</span><span style="color: #225588;"><<</span><span style="color: #22aa44;">"</span><span style="color: #f280d0;">\n</span><span style="color: #22aa44;"> doubles are 3.4, -8.65, 6.0 *** </span>
<span
style="color: #f280d0;">\n</span><span style="color: #22aa44;">"</span><span style="color: #225588;"><<</span><span style="color: #6688cc;">endl;</span></div>
<div style="color: #6688cc; background-color: #000c18; font-family: Consolas, 'Courier New', monospace; font-weight: normal; font-size: 19px; line-height: 1.5; white-space: pre;"><span style="color: #6688cc;">cout</span><span style="color: #225588;"><<</span><span style="color: #22aa44;">"</span><span style="color: #f280d0;">\n</span><span style="color: #22aa44;"> floats are 3.4f, -8.765f, 6.0f </span>
<span
style="color: #f280d0;">\n</span><span style="color: #22aa44;">"</span><span style="color: #225588;"><<</span><span style="color: #6688cc;">endl;</span></div>
<div style="color: #6688cc; background-color: #000c18; font-family: Consolas, 'Courier New', monospace; font-weight: normal; font-size: 19px; line-height: 1.5; white-space: pre;"><span style="color: #9966b8; font-style: italic;">double</span><span style="color: #6688cc;"> radius1, AREA;</span></div>
<div style="color: #6688cc; background-color: #000c18; font-family: Consolas, 'Courier New', monospace; font-weight: normal; font-size: 19px; line-height: 1.5; white-space: pre;"><span style="color: #6688cc;">cout</span><span style="color: #225588;"><<</span><span style="color: #22aa44;">"</span><span style="color: #f280d0;">\n</span><span style="color: #22aa44;"> ****** ***** a radius *** a circle </span>
<span
style="color: #f280d0;">\n</span><span style="color: #22aa44;">"</span><span style="color: #225588;"><<</span><span style="color: #6688cc;">endl;</span><span style="color: #6688cc;">cin</span><span style="color: #225588;">>></span><span style="color: #6688cc;">radius1;</span>
<span
style="color: #384887;">//AREA = PI * (radius1*radius1);</span><span style="color: #6688cc;">AREA </span><span style="color: #225588;">=</span><span style="color: #6688cc;"> M_PI </span><span style="color: #225588;">*</span>
<span
style="color: #6688cc;"> (radius1</span><span style="color: #225588;">*</span><span style="color: #6688cc;">radius1);</span><span style="color: #384887;"> /// M_PI is cmath ** Math PI. </span><span style="color: #6688cc;">cout</span>
<span
style="color: #225588;"><<</span><span style="color: #22aa44;">"</span><span style="color: #f280d0;">\n</span><span style="color: #22aa44;"> Area of the circle with radius of </span><span style="color: #f280d0;">\n</span><span style="color: #22aa44;">"</span>
<span
style="color: #225588;"><<</span><span style="color: #6688cc;"> radius1</span><span style="color: #225588;"><<</span><span style="color: #6688cc;"> </span><span style="color: #22aa44;">" is "</span><span style="color: #225588;"><<</span>
<span
style="color: #6688cc;"> AREA</span><span style="color: #225588;"><<</span><span style="color: #6688cc;">endl;</span><span style="color: #6688cc;">cout</span><span style="color: #225588;"><<</span><span style="color: #22aa44;">"</span>
<span
style="color: #f280d0;">\n</span><span style="color: #22aa44;"> Casting is converting one data **** to other type </span><span style="color: #f280d0;">\n</span><span style="color: #22aa44;">"</span><span style="color: #225588;"><<</span>
<span
style="color: #6688cc;">endl;</span><span style="color: #6688cc;">cout</span><span style="color: #225588;"><<</span><span style="color: #22aa44;">"</span><span style="color: #f280d0;">\n</span><span style="color: #22aa44;"> Doubles or floats ********* to integers , lose their value ***** decimal point </span>
<span
style="color: #f280d0;">\n</span><span style="color: #22aa44;">"</span><span style="color: #225588;"><<</span><span style="color: #6688cc;">endl;</span><span style="color: #6688cc;"> </span><span style="color: #9966b8; font-style: italic;">double</span>
<span
style="color: #6688cc;"> X2 </span><span style="color: #225588;">=</span><span style="color: #6688cc;"> (</span><span style="color: #9966b8; font-style: italic;">int</span><span style="color: #6688cc;">) </span>
<span
style="color: #f280d0;">6.99</span><span style="color: #6688cc;">;</span><span style="color: #6688cc;"> </span><span style="color: #9966b8; font-style: italic;">double</span><span style="color: #6688cc;"> XX1 </span>
<span
style="color: #225588;">=</span><span style="color: #6688cc;"> (</span><span style="color: #9966b8; font-style: italic;">int</span><span style="color: #6688cc;">) </span><span style="color: #f280d0;">6.7</span>
<span
style="color: #6688cc;">;</span><span style="color: #6688cc;"> </span><span style="color: #9966b8; font-style: italic;">double</span><span style="color: #6688cc;"> XX2 </span><span style="color: #225588;">=</span>
<span
style="color: #6688cc;"> (</span><span style="color: #9966b8; font-style: italic;">int</span><span style="color: #6688cc;">) </span><span style="color: #f280d0;">6.1</span><span style="color: #6688cc;">;</span>
<span
style="color: #6688cc;"> </span><span style="color: #9966b8; font-style: italic;">double</span><span style="color: #6688cc;"> XX3 </span><span style="color: #225588;">=</span>
<span
style="color: #6688cc;"> (</span><span style="color: #9966b8; font-style: italic;">int</span><span style="color: #6688cc;">) </span><span style="color: #f280d0;">6.9</span><span style="color: #6688cc;">; </span>
<span
style="color: #6688cc;">cout</span><span style="color: #225588;"><<</span><span style="color: #22aa44;">"</span><span style="color: #f280d0;">\n</span><span style="color: #22aa44;"> double X2 = (int) 6.9 </span>
<span
style="color: #f280d0;">\n</span><span style="color: #22aa44;">"</span><span style="color: #225588;"><<</span><span style="color: #6688cc;">endl;</span><span style="color: #6688cc;">cout</span>
<span
style="color: #225588;"><<</span><span style="color: #22aa44;">"</span><span style="color: #f280d0;">\n</span><span style="color: #22aa44;"> X2 = </span><span style="color: #f280d0;">\n</span>
<span
style="color: #22aa44;">"</span><span style="color: #225588;"><<</span><span style="color: #6688cc;"> X2</span><span style="color: #225588;"><<</span><span style="color: #6688cc;">endl;</span>
<span
style="color: #6688cc;">cout</span><span style="color: #225588;"><<</span><span style="color: #22aa44;">"</span><span style="color: #f280d0;">\n</span><span style="color: #22aa44;"> double XX1 = (int) 6.7 </span>
<span
style="color: #f280d0;">\n</span><span style="color: #22aa44;">"</span><span style="color: #225588;"><<</span><span style="color: #6688cc;">endl;</span><span style="color: #6688cc;">cout</span>
<span
style="color: #225588;"><<</span><span style="color: #22aa44;">"</span><span style="color: #f280d0;">\n</span><span style="color: #22aa44;"> XX1 = </span>
<span
style="color: #f280d0;">\n</span><span style="color: #22aa44;">"</span><span style="color: #225588;"><<</span><span style="color: #6688cc;"> XX1</span><span style="color: #225588;"><<</span>
<span
style="color: #6688cc;">endl;</span><span style="color: #6688cc;">cout</span><span style="color: #225588;"><<</span><span style="color: #22aa44;">"</span><span style="color: #f280d0;">\n</span>
<span
style="color: #22aa44;"> double XX2 = (int) 6.1 </span><span style="color: #f280d0;">\n</span><span style="color: #22aa44;">"</span><span style="color: #225588;"><<</span>
<span
style="color: #6688cc;">endl;</span><span style="color: #6688cc;">cout</span><span style="color: #225588;"><<</span><span style="color: #22aa44;">"</span>
<span
style="color: #f280d0;">\n</span><span style="color: #22aa44;"> XX2 = </span><span style="color: #f280d0;">\n</span><span style="color: #22aa44;">"</span>
<span
style="color: #225588;"><<</span><span style="color: #6688cc;"> XX2</span><span style="color: #225588;"><<</span><span style="color: #6688cc;">endl;</span>
<span
style="color: #6688cc;">cout</span><span style="color: #225588;"><<</span><span style="color: #22aa44;">"</span><span style="color: #f280d0;">\n</span>
<span
style="color: #22aa44;"> ****** XX3 = (int) 6.9 </span><span style="color: #f280d0;">\n</span><span style="color: #22aa44;">"</span>
<span
style="color: #225588;"><<</span><span style="color: #6688cc;">endl;</span><span style="color: #6688cc;">cout</span><span style="color: #225588;"><<</span>
<span
style="color: #22aa44;">"</span><span style="color: #f280d0;">\n</span><span style="color: #22aa44;"> XX3 = </span>
<span
style="color: #f280d0;">\n</span><span style="color: #22aa44;">"</span><span style="color: #225588;"><<</span><span style="color: #6688cc;"> XX3 </span>
<span
style="color: #225588;"><<</span><span style="color: #6688cc;">endl;</span><span style="color: #6688cc;">cout</span>
<span
style="color: #225588;"><<</span><span style="color: #22aa44;">"</span><span style="color: #f280d0;">\n</span><span style="color: #22aa44;"> Doubles or ****** converted to integers , lose their value after decimal ***** </span>
<span
style="color: #f280d0;">\n</span><span style="color: #22aa44;">"</span><span style="color: #225588;"><<</span>
<span
style="color: #6688cc;">endl;</span><br /><span style="color: #6688cc;">cout</span><span style="color: #225588;"><<</span>
<span
style="color: #22aa44;">"</span><span style="color: #f280d0;">\n</span><span style="color: #22aa44;"> 5/2 = "</span>
<span
style="color: #225588;"><<</span><span style="color: #6688cc;"> </span><span style="color: #f280d0;">5</span>
<span
style="color: #225588;">/</span><span style="color: #f280d0;">2</span><span style="color: #6688cc;"> </span>
<span
style="color: #225588;"><<</span><span style="color: #6688cc;">endl;</span><span style="color: #6688cc;">cout</span>
<span
style="color: #225588;"><<</span><span style="color: #22aa44;">"</span><span style="color: #f280d0;">\n</span>
<span
style="color: #22aa44;"> 5.0/2.0 = "</span><span style="color: #225588;"><<</span>
<span
style="color: #6688cc;"> </span><span style="color: #f280d0;">5.0</span><span style="color: #225588;">/</span>
<span
style="color: #f280d0;">2.0</span><span style="color: #6688cc;"> </span>
<span
style="color: #225588;"><<</span><span style="color: #6688cc;">endl;</span></div>
<div style="color: #6688cc; background-color: #000c18; font-family: Consolas, 'Courier New', monospace; font-weight: normal; font-size: 19px; line-height: 1.5; white-space: pre;"> </div>
<div style="color: #6688cc; background-color: #000c18; font-family: Consolas, 'Courier New', monospace; font-weight: normal; font-size: 19px; line-height: 1.5; white-space: pre;"><span style="color: #6688cc;">cout</span><span style="color: #225588;"><<</span><span style="color: #22aa44;">"</span><span style="color: #f280d0;">\n</span><span style="color: #22aa44;"> 5.0/2 = "</span><span style="color: #225588;"><<</span>
<span
style="color: #6688cc;"> </span><span style="color: #f280d0;">5.0</span><span style="color: #225588;">/</span><span style="color: #f280d0;">2</span><span style="color: #225588;"><<</span><span style="color: #6688cc;">endl;</span><span style="color: #384887;"> // </span><br
/><span style="color: #9966b8; font-style: italic;">int</span><span style="color: #6688cc;"> xxx </span><span style="color: #225588;">=</span><span style="color: #6688cc;"> </span><span style="color: #f280d0;">5</span>
<span
style="color: #225588;">/</span><span style="color: #f280d0;">2</span><span style="color: #6688cc;">;</span><span style="color: #9966b8; font-style: italic;">double</span><span style="color: #6688cc;"> yyy </span><span style="color: #225588;">=</span>
<span
style="color: #6688cc;"> </span><span style="color: #f280d0;">5</span><span style="color: #225588;">/</span><span style="color: #f280d0;">2</span><span style="color: #6688cc;">;</span><span style="color: #9966b8; font-style: italic;">float</span>
<span
style="color: #6688cc;"> zzz </span><span style="color: #225588;">=</span><span style="color: #6688cc;"> </span><span style="color: #f280d0;">5</span><span style="color: #225588;">/</span><span style="color: #f280d0;">2</span><span style="color: #6688cc;">;</span>
<span
style="color: #6688cc;">cout</span><span style="color: #225588;"><<</span><span style="color: #22aa44;">"</span><span style="color: #f280d0;">\n</span><span style="color: #22aa44;"> int *** = 5/2, </span></div>
<div style="color: #6688cc; background-color: #000c18; font-family: Consolas, 'Courier New', monospace; font-weight: normal; font-size: 19px; line-height: 1.5; white-space: pre;"><span style="color: #22aa44;">so xxx= </span><span style="color: #f280d0;">\n</span><span style="color: #22aa44;">"</span><span style="color: #225588;"><<</span><span style="color: #6688cc;"> xxx </span><span style="color: #225588;"><<</span>
<span
style="color: #6688cc;">endl;</span>
</div>
<div style="color: #6688cc; background-color: #000c18; font-family: Consolas, 'Courier New', monospace; font-weight: normal; font-size: 19px; line-height: 1.5; white-space: pre;"><span style="color: #6688cc;">cout</span><span style="color: #225588;"><<</span><span style="color: #22aa44;">"</span><span style="color: #f280d0;">\n</span><span style="color: #22aa44;"> double *** = 5/2, yyy = </span>
<span
style="color: #f280d0;">\n</span><span style="color: #22aa44;">"</span><span style="color: #225588;"><<</span><span style="color: #6688cc;"> yyy</span><span style="color: #225588;"><<</span><span style="color: #6688cc;">endl;</span></div>
<div style="color: #6688cc; background-color: #000c18; font-family: Consolas, 'Courier New', monospace; font-weight: normal; font-size: 19px; line-height: 1.5; white-space: pre;"><span style="color: #6688cc;">cout</span><span style="color: #225588;"><<</span><span style="color: #22aa44;">"</span><span style="color: #f280d0;">\n</span><span style="color: #22aa44;"> float zzz = 5/2, zzz = </span>
<span
style="color: #f280d0;">\n</span><span style="color: #22aa44;">"</span><span style="color: #225588;"><<</span><span style="color: #6688cc;"> zzz</span><span style="color: #225588;"><<</span><span style="color: #6688cc;">endl;</span></div>
<div style="color: #6688cc; background-color: #000c18; font-family: Consolas, 'Courier New', monospace; font-weight: normal; font-size: 19px; line-height: 1.5; white-space: pre;"><span style="color: #6688cc;">cout</span><span style="color: #225588;"><<</span><span style="color: #22aa44;">"</span><span style="color: #f280d0;">\n</span><span style="color: #22aa44;"> Compiler does the ******* </span>
<span
style="color: #f280d0;">\n</span><span style="color: #22aa44;">"</span><span style="color: #225588;"><<</span><span style="color: #6688cc;">endl;</span><br /><br /><span style="color: #6688cc;">cout</span><span style="color: #225588;"><<</span><span style="color: #22aa44;">"</span>
<span
style="color: #f280d0;">\n</span><span style="color: #22aa44;"> 'char' or Characters *** letters </span><span style="color: #f280d0;">\n</span><span style="color: #22aa44;">"</span><span style="color: #225588;"><<</span><span style="color: #6688cc;">endl;</span></div>
<div style="color: #6688cc; background-color: #000c18; font-family: Consolas, 'Courier New', monospace; font-weight: normal; font-size: 19px; line-height: 1.5; white-space: pre;"><span style="color: #6688cc;">cout</span><span style="color: #225588;"><<</span><span style="color: #22aa44;">"</span><span style="color: #f280d0;">\n</span><span style="color: #22aa44;"> Each 'char' data uses 1 byte ** 8 bits </span>
<span
style="color: #f280d0;">\n</span><span style="color: #22aa44;">"</span><span style="color: #225588;"><<</span><span style="color: #6688cc;">endl;</span><span style="color: #6688cc;">cout</span><span style="color: #225588;"><<</span><span style="color: #22aa44;">"</span>
<span
style="color: #f280d0;">\n</span><span style="color: #22aa44;"> Repressented ** ASCII table and mapped value. </span><span style="color: #f280d0;">\n</span><span style="color: #22aa44;">"</span><span style="color: #225588;"><<</span>
<span
style="color: #6688cc;">endl;</span><br /><span style="color: #9966b8; font-style: italic;">char</span><span style="color: #6688cc;"> xx </span><span style="color: #225588;">=</span><span style="color: #6688cc;"> (</span><span style="color: #9966b8; font-style: italic;">char</span>
<span
style="color: #6688cc;">) </span><span style="color: #f280d0;">97</span><span style="color: #6688cc;">;</span><span style="color: #6688cc;">cout</span><span style="color: #225588;"><<</span><span style="color: #22aa44;">"(char) 65 will show"</span>
<span
style="color: #6688cc;"> </span><span style="color: #225588;"><<</span><span style="color: #6688cc;">(</span><span style="color: #9966b8; font-style: italic;">char</span><span style="color: #6688cc;">) </span><span style="color: #f280d0;">65</span>
<span
style="color: #6688cc;"> </span><span style="color: #225588;"><<</span><span style="color: #6688cc;">endl;</span><span style="color: #6688cc;">cout</span><span style="color: #225588;"><<</span><span style="color: #22aa44;">"xx = (char) 97 , xx = "</span>
<span
style="color: #6688cc;"> </span><span style="color: #225588;"><<</span><span style="color: #6688cc;"> xx </span><span style="color: #225588;"><<</span><span style="color: #6688cc;">endl;</span><span style="color: #6688cc;">cout</span>
<span
style="color: #225588;"><<</span><span style="color: #22aa44;">"</span><span style="color: #f280d0;">\n</span><span style="color: #22aa44;"> (char) 65, this casts 65 to char A on ASCII map table </span><span style="color: #f280d0;">\n</span>
<span
style="color: #22aa44;">"</span><span style="color: #225588;"><<</span><span style="color: #6688cc;">endl;</span><span style="color: #6688cc;">cout</span><span style="color: #225588;"><<</span><span style="color: #22aa44;">"</span>
<span
style="color: #f280d0;">\n</span><span style="color: #22aa44;"> Please enter a character </span><span style="color: #f280d0;">\n</span><span style="color: #22aa44;">"</span><span style="color: #225588;"><<</span>
<span
style="color: #6688cc;">endl;</span><span style="color: #9966b8; font-style: italic;">char</span><span style="color: #6688cc;"> Charin;</span><span style="color: #6688cc;">cin</span><span style="color: #225588;">>></span>
<span
style="color: #6688cc;"> Charin;</span><span style="color: #9966b8; font-style: italic;">int</span><span style="color: #6688cc;"> asciivalue</span><span style="color: #225588;">=</span><span style="color: #f280d0;">0</span>
<span
style="color: #6688cc;">;</span><span style="color: #6688cc;">asciivalue </span><span style="color: #225588;">=</span><span style="color: #6688cc;"> (</span><span style="color: #9966b8; font-style: italic;">int</span>
<span
style="color: #6688cc;">) Charin;</span><br /><span style="color: #6688cc;">cout</span><span style="color: #225588;"><<</span><span style="color: #6688cc;">Charin</span><span style="color: #225588;"><<</span>
<span
style="color: #22aa44;">" ASCII value is "</span><span style="color: #225588;"><<</span><span style="color: #6688cc;"> asciivalue</span><span style="color: #225588;"><<</span>
<span
style="color: #6688cc;">endl;</span><br /><span style="color: #9966b8; font-style: italic;">char</span><span style="color: #6688cc;"> ch1 </span><span style="color: #225588;">=</span><span style="color: #6688cc;"> </span>
<span
style="color: #22aa44;">'a'</span><span style="color: #6688cc;">;</span><span style="color: #9966b8; font-style: italic;">char</span><span style="color: #6688cc;"> ch2 </span><span style="color: #225588;">=</span>
<span
style="color: #6688cc;"> </span><span style="color: #22aa44;">'B'</span><span style="color: #6688cc;">;</span><br /><span style="color: #6688cc;">cout</span><span style="color: #225588;"><<</span>
<span
style="color: #22aa44;">"</span><span style="color: #f280d0;">\n</span><span style="color: #22aa44;"> char *** = 'a', char ch2 = 'B' ;- is *** way ** assign a</span></div>
<div style="color: #6688cc; background-color: #000c18; font-family: Consolas, 'Courier New', monospace; font-weight: normal; font-size: 19px; line-height: 1.5; white-space: pre;"><span style="color: #22aa44;"> char ** a variable</span><span style="color: #f280d0;">\n</span><span style="color: #22aa44;">"</span><span style="color: #225588;"><<</span><span style="color: #6688cc;">endl;</span><span style="color: #6688cc;">cout</span>
<span
style="color: #225588;"><<</span><span style="color: #22aa44;">"</span><span style="color: #f280d0;">\n</span><span style="color: #22aa44;"> ch1 = "</span><span style="color: #225588;"><<</span><span style="color: #6688cc;"> ch1</span>
<span
style="color: #225588;"><<</span><span style="color: #6688cc;">endl;</span><span style="color: #6688cc;">cout</span><span style="color: #225588;"><<</span><span style="color: #22aa44;">"</span><span style="color: #f280d0;">\n</span><span style="color: #22aa44;"> ch2 ="</span>
<span
style="color: #225588;"><<</span><span style="color: #6688cc;"> ch2 </span><span style="color: #225588;"><<</span><span style="color: #6688cc;">endl;</span><span style="color: #6688cc;">cout</span><span style="color: #225588;"><<</span>
<span
style="color: #22aa44;">"</span><span style="color: #f280d0;">\n</span><span style="color: #22aa44;"> ch3 = '</span><span style="color: #f280d0;">\n</span><span style="color: #22aa44;">', will produce a new line only , ** ch3 is printed </span>
<span
style="color: #f280d0;">\n</span><span style="color: #22aa44;">"</span><span style="color: #225588;"><<</span><span style="color: #6688cc;">endl;</span><span style="color: #6688cc;">cout</span><span style="color: #225588;"><<</span>
<span
style="color: #22aa44;">"</span><span style="color: #f280d0;">\n</span><span style="color: #22aa44;"> '</span><span style="color: #f280d0;">\t</span><span style="color: #22aa44;">' ** for tab or four spaces </span><span style="color: #f280d0;">\n</span>
<span
style="color: #22aa44;">"</span><span style="color: #225588;"><<</span><span style="color: #6688cc;">endl;</span><span style="color: #9966b8; font-style: italic;">char</span><span style="color: #6688cc;"> CH1, CH2, CH3;</span>
<span
style="color: #6688cc;">CH1 </span><span style="color: #225588;">=</span><span style="color: #6688cc;"> </span><span style="color: #22aa44;">'a'</span><span style="color: #6688cc;">;</span><span style="color: #6688cc;">CH2 </span>
<span
style="color: #225588;">=</span><span style="color: #6688cc;"> </span><span style="color: #22aa44;">'a'</span><span style="color: #6688cc;"> </span><span style="color: #225588;">+</span><span style="color: #6688cc;"> </span>
<span
style="color: #f280d0;">1</span><span style="color: #6688cc;">;</span><span style="color: #6688cc;">CH3 </span><span style="color: #225588;">=</span><span style="color: #6688cc;"> </span><span style="color: #22aa44;">'CH2'</span>
<span
style="color: #6688cc;"> </span><span style="color: #225588;">+</span><span style="color: #6688cc;"> </span><span style="color: #f280d0;">1</span><span style="color: #6688cc;">; </span><span style="color: #6688cc;">cout</span>
<span
style="color: #225588;"><<</span><span style="color: #22aa44;">"</span><span style="color: #f280d0;">\n</span><span style="color: #22aa44;"> warning: multi-character ********* ******** -Wmultichar . warning: overflow in conversion from 'int' to 'char' changes value from '4409395' ** '3' -Woverflow</span>
<span
style="color: #f280d0;">\n</span><span style="color: #22aa44;">"</span><span style="color: #6688cc;"> </span><span style="color: #225588;"><<</span><span style="color: #6688cc;">endl;</span><span style="color: #6688cc;">cout</span>
<span
style="color: #225588;"><<</span><span style="color: #22aa44;">"</span><span style="color: #f280d0;">\n</span><span style="color: #22aa44;"> **** CH1, CH2, CH3; CH1 = 'a';CH2 = 'a' + 1;CH3 = 'CH2' + 1; </span>
<span
style="color: #f280d0;">\n</span><span style="color: #22aa44;">"</span><span style="color: #225588;"><<</span><span style="color: #6688cc;">endl;</span><span style="color: #6688cc;">cout</span><span style="color: #225588;"><<</span>
<span
style="color: #22aa44;">"</span><span style="color: #f280d0;">\n</span><span style="color: #22aa44;"> CH1 = "</span><span style="color: #225588;"><<</span><span style="color: #6688cc;"> CH1</span>
<span
style="color: #225588;"><<</span><span style="color: #6688cc;">endl;</span><span style="color: #6688cc;">cout</span><span style="color: #225588;"><<</span><span style="color: #22aa44;">"</span>
<span
style="color: #f280d0;">\n</span><span style="color: #22aa44;"> CH2 = "</span><span style="color: #225588;"><<</span><span style="color: #6688cc;"> CH2</span><span style="color: #225588;"><<</span>
<span
style="color: #6688cc;">endl;</span><span style="color: #6688cc;">cout</span><span style="color: #225588;"><<</span><span style="color: #22aa44;">"</span><span style="color: #f280d0;">\n</span>
<span
style="color: #22aa44;"> CH3 = "</span><span style="color: #225588;"><<</span><span style="color: #6688cc;"> CH3</span><span style="color: #225588;"><<</span>
<span
style="color: #6688cc;">endl;</span><span style="color: #6688cc;">cout</span><span style="color: #225588;"><<</span><span style="color: #22aa44;">"</span><span style="color: #f280d0;">\n</span>
<span
style="color: #22aa44;"> 'a' + 1 = "</span><span style="color: #225588;"><<</span><span style="color: #6688cc;"> </span><span style="color: #22aa44;">'a'</span>
<span
style="color: #6688cc;"> </span><span style="color: #225588;">+</span><span style="color: #6688cc;"> </span><span style="color: #f280d0;">1</span><span style="color: #6688cc;"> </span>
<span
style="color: #225588;"><<</span><span style="color: #6688cc;">endl;</span><span style="color: #384887;"> // 'char' a is casted to int , to preserve accuracy. </span>
<span
style="color: #6688cc;">cout</span><span style="color: #225588;"><<</span><span style="color: #22aa44;">"</span><span style="color: #f280d0;">\n</span><span style="color: #22aa44;"> // 'char' a is casted to int , to preserve accuracy. </span>
<span
style="color: #f280d0;">\n</span><span style="color: #22aa44;">"</span><span style="color: #225588;"><<</span><span style="color: #6688cc;">endl;</span>
<span
style="color: #6688cc;">cout</span><span style="color: #225588;"><<</span><span style="color: #22aa44;">"</span><span style="color: #f280d0;">\n</span>
<span
style="color: #22aa44;"> (char) 'a' + 1 = "</span><span style="color: #225588;"><<</span><span style="color: #6688cc;"> (</span><span style="color: #9966b8; font-style: italic;">char</span>
<span
style="color: #6688cc;">) </span><span style="color: #22aa44;">'a'</span><span style="color: #6688cc;"> </span><span style="color: #225588;">+</span>
<span
style="color: #6688cc;"> </span><span style="color: #f280d0;">1</span><span style="color: #6688cc;"> </span><span style="color: #225588;"><<</span>
<span
style="color: #6688cc;">endl;</span><span style="color: #384887;"> // 'char' a is casted to int , because a *** be casted to int withot loosing accuracy. but *** 1 can not casted ** a char without loosing accuracy. </span>
<span
style="color: #6688cc;">cout</span><span style="color: #225588;"><<</span><span style="color: #22aa44;">"</span><span style="color: #f280d0;">\n</span>
<span
style="color: #22aa44;"> // 'char' a ** casted to int , because a can be casted to *** withot loosing accuracy. but *** 1 can not
casted to a char without loosing accuracy. </span><span style="color: #f280d0;">\n</span><span style="color: #22aa44;">"</span>
<span
style="color: #225588;"><<</span><span style="color: #6688cc;">endl;</span><span style="color: #6688cc;">cout</span><span style="color: #225588;"><<</span>
<span
style="color: #22aa44;">"</span><span style="color: #f280d0;">\n</span><span style="color: #22aa44;"> (char) ('a' + 1) = "</span>
<span
style="color: #225588;"><<</span><span style="color: #6688cc;"> (</span><span style="color: #9966b8; font-style: italic;">char</span>
<span
style="color: #6688cc;">) (</span><span style="color: #22aa44;">'a'</span><span style="color: #6688cc;"> </span>
<span
style="color: #225588;">+</span><span style="color: #6688cc;"> </span><span style="color: #f280d0;">1</span>
<span
style="color: #6688cc;"> )</span><span style="color: #225588;"><<</span><span style="color: #6688cc;">endl;</span><br
/><br /><span style="color: #9966b8; font-style: italic;">char</span><span style="color: #6688cc;"> lowcaseletter, uppercaseletter;</span>
<span
style="color: #9966b8; font-style: italic;">int</span><span style="color: #6688cc;"> offset;</span><br /><span style="color: #6688cc;">cout</span>
<span
style="color: #225588;"><<</span><span style="color: #22aa44;">"</span><span style="color: #f280d0;">\n</span>
<span
style="color: #22aa44;"> Please enter a lower case letter: "</span><span style="color: #225588;"><<</span>
<span
style="color: #6688cc;">endl;</span><br /><span style="color: #6688cc;">cin</span><span style="color: #225588;">>></span>
<span
style="color: #6688cc;"> lowcaseletter;</span><br /><span style="color: #6688cc;">offset </span>
<span
style="color: #225588;">=</span><span style="color: #6688cc;"> (</span><span style="color: #9966b8; font-style: italic;">int</span>
<span
style="color: #6688cc;">) (lowcaseletter </span><span style="color: #225588;">-</span>
<span
style="color: #6688cc;"> </span><span style="color: #22aa44;">'a'</span>
<span
style="color: #6688cc;">);</span><br /><span style="color: #6688cc;">uppercaseletter </span>
<span
style="color: #225588;">=</span><span style="color: #6688cc;"> (</span>
<span
style="color: #9966b8; font-style: italic;">char</span><span style="color: #6688cc;">)(</span>
<span
style="color: #22aa44;">'A'</span><span style="color: #6688cc;"> </span>
<span
style="color: #225588;">+</span><span style="color: #6688cc;"> offset);</span><br
/><span style="color: #6688cc;">cout</span>
<span
style="color: #225588;"><<</span><span style="color: #22aa44;">"</span>
<span
style="color: #f280d0;">\n</span><span style="color: #22aa44;"> ********* of "</span>
<span
style="color: #225588;"><<</span><span style="color: #6688cc;"> lowcaseletter</span>
<span
style="color: #225588;"><<</span>
<span
style="color: #6688cc;"> </span>
<span
style="color: #22aa44;">" is "</span>
<span
style="color: #6688cc;"> </span>
<span
style="color: #225588;"><<</span>
<span
style="color: #6688cc;"> uppercaseletter</span>
<span
style="color: #225588;"><<</span>
<span
style="color: #6688cc;">endl;</span><br
/><br
/>
<span
style="color: #9966b8; font-style: italic;">char</span>
<span
style="color: #6688cc;"> Lowercaseletter,
Uppercaseletter;</span><br
/>
<span
style="color: #6688cc;">cout</span>
<span
style="color: #225588;"><<</span>
<span
style="color: #22aa44;">"</span>
<span
style="color: #f280d0;">\n</span>
<span
style="color: #22aa44;"> Please
*****
a
Upper-case
letter:
"</span>
<span
style="color: #225588;"><<</span>
<span
style="color: #6688cc;">endl;</span><br
/>
<span
style="color: #6688cc;">cin</span>
<span
style="color: #225588;">>></span>
<span
style="color: #6688cc;">
Uppercaseletter;</span><br
/>
<span
style="color: #9966b8; font-style: italic;">int</span>
<span
style="color: #6688cc;"> Offset </span>
<span
style="color: #225588;">=</span>
<span
style="color: #6688cc;"> </span>
<span
style="color: #f280d0;">32</span>
<span
style="color: #6688cc;">;</span>
<span
style="color: #384887;">
///
32
**
***
**********
between
uppercase</span>
</div>
<div style="color: #6688cc; background-color: #000c18; font-family: Consolas, 'Courier New', monospace; font-weight: normal; font-size: 19px; line-height: 1.5; white-space: pre;"><span style="color: #384887;"> and lowercase letters in ascii table. </span><br /><span style="color: #6688cc;">Lowercaseletter </span><span style="color: #225588;">=</span><span style="color: #6688cc;"> (</span><span style="color: #9966b8; font-style: italic;">char</span>
<span
style="color: #6688cc;">) (Uppercaseletter </span><span style="color: #225588;">+</span><span style="color: #6688cc;"> Offset);</span><span style="color: #384887;"> /// Uppercaseletter</span></div>
<div style="color: #6688cc; background-color: #000c18; font-family: Consolas, 'Courier New', monospace; font-weight: normal; font-size: 19px; line-height: 1.5; white-space: pre;"><span style="color: #384887;"> letter is casted to int, then ************** + Offset in combinely casted to 'char'.</span><br /><span style="color: #6688cc;">cout</span><span style="color: #225588;"><<</span><span style="color: #22aa44;">"</span>
<span
style="color: #f280d0;">\n</span><span style="color: #22aa44;"> Lowercase of "</span><span style="color: #225588;"><<</span><span style="color: #6688cc;"> Uppercaseletter</span><span style="color: #225588;"><<</span><span style="color: #6688cc;"> </span>
<span
style="color: #22aa44;">" is "</span><span style="color: #6688cc;"> </span><span style="color: #225588;"><<</span><span style="color: #6688cc;"> Lowercaseletter</span><span style="color: #225588;"><<</span><span style="color: #6688cc;">endl;</span><br
/><br /><span style="color: #6688cc;">cout</span><span style="color: #225588;"><<</span><span style="color: #22aa44;">"</span><span style="color: #f280d0;">\n</span><span style="color: #22aa44;"> 'string' is not a ***** ** data type in C++, we have ** </span></div>
<div style="color: #6688cc; background-color: #000c18; font-family: Consolas, 'Courier New', monospace; font-weight: normal; font-size: 19px; line-height: 1.5; white-space: pre;"><span style="color: #22aa44;">#include <string> to use string data type </span><span style="color: #f280d0;">\n</span><span style="color: #22aa44;">"</span><span style="color: #225588;"><<</span><span style="color: #6688cc;">endl;</span>
<span
style="color: #6688cc;">cout</span><span style="color: #225588;"><<</span><span style="color: #22aa44;">"</span><span style="color: #f280d0;">\n</span><span style="color: #22aa44;"> string is a sequence of characters </span><span style="color: #f280d0;">\n</span>
<span
style="color: #22aa44;">"</span><span style="color: #225588;"><<</span><span style="color: #6688cc;">endl;</span><span style="color: #6688cc;">cout</span><span style="color: #225588;"><<</span><span style="color: #22aa44;">"</span><span style="color: #f280d0;">\n</span>
<span
style="color: #22aa44;"> String *********** with + is possible </span><span style="color: #f280d0;">\n</span><span style="color: #22aa44;">"</span><span style="color: #225588;"><<</span><span style="color: #6688cc;">endl;</span><br />
<span
style="color: #6688cc;">string s;</span><span style="color: #6688cc;">s </span><span style="color: #225588;">=</span><span style="color: #6688cc;"> </span><span style="color: #22aa44;">" Hello "</span><span style="color: #6688cc;">;</span><br
/><span style="color: #6688cc;">cout</span><span style="color: #225588;"><<</span><span style="color: #22aa44;">"</span><span style="color: #f280d0;">\n</span><span style="color: #22aa44;"> ****** s, s = 'Hello' so s = "</span>
<span
style="color: #225588;"><<</span><span style="color: #6688cc;"> s </span><span style="color: #225588;"><<</span><span style="color: #6688cc;">endl;</span><br /><span style="color: #6688cc;">cout</span><span style="color: #225588;"><<</span>
<span
style="color: #22aa44;">"</span><span style="color: #f280d0;">\n</span><span style="color: #22aa44;"> string s, s = 'Hello' so s + world = "</span><span style="color: #225588;"><<</span><span style="color: #6688cc;"> s </span>
<span
style="color: #225588;">+</span><span style="color: #6688cc;"> </span><span style="color: #22aa44;">"world"</span><span style="color: #6688cc;"> </span><span style="color: #225588;"><<</span><span style="color: #6688cc;">endl;</span><br
/><span style="color: #6688cc;">s </span><span style="color: #225588;">=</span><span style="color: #6688cc;"> s </span><span style="color: #225588;">+</span><span style="color: #6688cc;"> </span>
<span
style="color: #22aa44;">" world "</span><span style="color: #6688cc;">;</span><br /><span style="color: #6688cc;">cout</span><span style="color: #225588;"><<</span><span style="color: #22aa44;">"</span><span style="color: #f280d0;">\n</span>
<span
style="color: #22aa44;"> string s, s = 'Hello' so s = s + world = "</span><span style="color: #225588;"><<</span><span style="color: #6688cc;"> s </span><span style="color: #225588;"><<</span><span style="color: #6688cc;">endl;</span><br
/><span style="color: #6688cc;">cout</span><span style="color: #225588;"><<</span><span style="color: #22aa44;">"</span><span style="color: #f280d0;">\n</span><span style="color: #22aa44;"> String *********** with + ** possible </span>
<span
style="color: #f280d0;">\n</span><span style="color: #22aa44;">"</span><span style="color: #225588;"><<</span><span style="color: #6688cc;">endl;</span><br /><br /><span style="color: #6688cc;">cout</span><span style="color: #225588;"><<</span>
<span
style="color: #22aa44;">"</span><span style="color: #f280d0;">\n</span><span style="color: #22aa44;"> string s, s = 'Hello' so s = s + world = "</span><span style="color: #225588;"><<</span><span style="color: #6688cc;"> s </span>
<span
style="color: #225588;"><<</span><span style="color: #6688cc;">endl;</span><br /><span style="color: #6688cc;">cout</span><span style="color: #225588;"><<</span><span style="color: #22aa44;">"</span><span style="color: #f280d0;">\n</span>
<span
style="color: #22aa44;"> String concatening with + is ******** </span><span style="color: #f280d0;">\n</span><span style="color: #22aa44;">"</span><span style="color: #225588;"><<</span>
<span
style="color: #6688cc;">endl;</span><br /><span style="color: #6688cc;">cout</span><span style="color: #225588;"><<</span><span style="color: #22aa44;">"</span><span style="color: #f280d0;">\n</span>
<span
style="color: #22aa44;"> C++ Booleans; Very often, in programming, you will **** </span>
</div>
<div style="color: #6688cc; background-color: #000c18; font-family: Consolas, 'Courier New', monospace; font-weight: normal; font-size: 19px; line-height: 1.5; white-space: pre;"><span style="color: #22aa44;">a data type that can only **** one of two values, like:YES / NO, ON / OFF,</span></div>
<div style="color: #6688cc; background-color: #000c18; font-family: Consolas, 'Courier New', monospace; font-weight: normal; font-size: 19px; line-height: 1.5; white-space: pre;"><span style="color: #22aa44;"> TRUE / FALSE ; *** this, C++ has a bool data type, which can take the </span></div>
<div style="color: #6688cc; background-color: #000c18; font-family: Consolas, 'Courier New', monospace; font-weight: normal; font-size: 19px; line-height: 1.5; white-space: pre;"><span style="color: #22aa44;">values true (1) or false (0). Boolean Values A ******* variable is</span></div>
<div style="color: #6688cc; background-color: #000c18; font-family: Consolas, 'Courier New', monospace; font-weight: normal; font-size: 19px; line-height: 1.5; white-space: pre;"><span style="color: #22aa44;"> declared with the bool keyword and can only take the values true or</span></div>
<div style="color: #6688cc; background-color: #000c18; font-family: Consolas, 'Courier New', monospace; font-weight: normal; font-size: 19px; line-height: 1.5; white-space: pre;"><span style="color: #22aa44;"> false: Example, bool isCodingFun = true; **** isFishTasty = false; </span></div>
<div style="color: #6688cc; background-color: #000c18; font-family: Consolas, 'Courier New', monospace; font-weight: normal; font-size: 19px; line-height: 1.5; white-space: pre;"><span style="color: #22aa44;"> **** << isCodingFun; // Outputs 1 (true) cout << isFishTasty; </span></div>
<div style="color: #6688cc; background-color: #000c18; font-family: Consolas, 'Courier New', monospace; font-weight: normal; font-size: 19px; line-height: 1.5; white-space: pre;"><span style="color: #22aa44;"> // ******* 0 (false) From the example above, you can read that a true</span></div>
<div style="color: #6688cc; background-color: #000c18; font-family: Consolas, 'Courier New', monospace; font-weight: normal; font-size: 19px; line-height: 1.5; white-space: pre;"><span style="color: #22aa44;"> value returns 1, and false returns 0. However, it is more common to</span></div>
<div style="color: #6688cc; background-color: #000c18; font-family: Consolas, 'Courier New', monospace; font-weight: normal; font-size: 19px; line-height: 1.5; white-space: pre;"><span style="color: #22aa44;"> return ******* values from boolean expressions (see next page).</span><span style="color: #f280d0;">\n</span><span style="color: #22aa44;">"</span><span style="color: #225588;"><<</span><span style="color: #6688cc;">endl;</span><br
/><span style="color: #6688cc;">cout</span><span style="color: #225588;"><<</span><span style="color: #22aa44;">"</span><span style="color: #f280d0;">\n</span><span style="color: #22aa44;"> C++ Boolean Expressions : - A Boolean expression is a C++ </span></div>
<div style="color: #6688cc; background-color: #000c18; font-family: Consolas, 'Courier New', monospace; font-weight: normal; font-size: 19px; line-height: 1.5; white-space: pre;"><span style="color: #22aa44;">expression that ******* a ******* value: 1 (true) ** 0 (false). </span></div>
<div style="color: #6688cc; background-color: #000c18; font-family: Consolas, 'Courier New', monospace; font-weight: normal; font-size: 19px; line-height: 1.5; white-space: pre;"><span style="color: #22aa44;">You can use a ********** operator, such ** the greater than (>) operator </span></div>
<div style="color: #6688cc; background-color: #000c18; font-family: Consolas, 'Courier New', monospace; font-weight: normal; font-size: 19px; line-height: 1.5; white-space: pre;"><span style="color: #22aa44;">to find out ** an expression (or a variable) is true: ******* , int x = 10; int y = 9; cout << (x > y); // ******* 1 (true), because ** is higher than 9 Or even easier: Example cout << (10 > 9); // returns 1 (true), because 10 is higher than 9 In the examples below, we *** the equal to (==) operator to evaluate an expression: Example , *** x = 10; **** << (x == 10); // returns 1 (true), because the value of x ** equal to 10; ******* **** << (10 == 15); // ******* 0 (false), because 10 is not equal to 15</span>
<span
style="color: #22aa44;">Booleans are the basis for all C++ comparisons and conditions. "</span><span style="color: #225588;"><<</span><span style="color: #6688cc;"> s </span><span style="color: #225588;"><<</span>
<span
style="color: #6688cc;">endl;</span><br /><br /><br /><br /><span style="color: #6688cc;">cout</span><span style="color: #225588;"><<</span><span style="color: #22aa44;">"</span><span style="color: #f280d0;">\n</span><span style="color: #22aa44;"> bool ** boolean is True or False values , data ** one byte ** </span></div>
<div style="color: #6688cc; background-color: #000c18; font-family: Consolas, 'Courier New', monospace; font-weight: normal; font-size: 19px; line-height: 1.5; white-space: pre;"><span style="color: #22aa44;">8 bit, butsingle bit is enough </span><span style="color: #f280d0;">\n</span><span style="color: #22aa44;">"</span><span style="color: #225588;"><<</span><span style="color: #6688cc;">endl;</span>
<span
style="color: #6688cc;">cout</span><span style="color: #225588;"><<</span><span style="color: #22aa44;">"</span><span style="color: #f280d0;">\n</span><span style="color: #22aa44;"> False is represented</span></div>
<div style="color: #6688cc; background-color: #000c18; font-family: Consolas, 'Courier New', monospace; font-weight: normal; font-size: 19px; line-height: 1.5; white-space: pre;"><span style="color: #22aa44;"> by a ****** byte / 8 bit Zero, True is *** non Zero Value </span><span style="color: #f280d0;">\n</span><span style="color: #22aa44;">"</span><span style="color: #225588;"><<</span><span style="color: #6688cc;">endl;</span>
<span
style="color: #6688cc;">cout</span><span style="color: #225588;"><<</span><span style="color: #22aa44;">"</span><span style="color: #f280d0;">\n</span><span style="color: #22aa44;"> C++ bool literals are 'true' ** 'false' </span><span style="color: #f280d0;">\n</span>
<span
style="color: #22aa44;">"</span><span style="color: #225588;"><<</span><span style="color: #6688cc;">endl;</span><span style="color: #6688cc;">cout</span><span style="color: #225588;"><<</span><span style="color: #22aa44;">"</span><span style="color: #f280d0;">\n</span>
<span
style="color: #22aa44;"> 'Not' or '!' Operator </span><span style="color: #f280d0;">\n</span><span style="color: #22aa44;">"</span><span style="color: #225588;"><<</span><span style="color: #6688cc;">endl;</span><span style="color: #6688cc;">cout</span>
<span
style="color: #225588;"><<</span><span style="color: #22aa44;">"</span><span style="color: #f280d0;">\n</span><span style="color: #22aa44;"> bool b1, b2, b3 </span><span style="color: #f280d0;">\n</span><span style="color: #22aa44;">"</span>
<span
style="color: #225588;"><<</span><span style="color: #6688cc;">endl;</span><span style="color: #6688cc;">cout</span><span style="color: #225588;"><<</span><span style="color: #22aa44;">"</span><span style="color: #f280d0;">\n</span>
<span
style="color: #22aa44;"> b1 = true; b2 = !b1, so b2 = !true, so b2 = false </span><span style="color: #f280d0;">\n</span><span style="color: #22aa44;">"</span><span style="color: #225588;"><<</span><span style="color: #6688cc;">endl;</span>
<span
style="color: #6688cc;">cout</span><span style="color: #225588;"><<</span><span style="color: #22aa44;">"</span><span style="color: #f280d0;">\n</span><span style="color: #22aa44;"> b3 = !false; ** b3 = true = b1 = !b2 </span>
<span
style="color: #f280d0;">\n</span><span style="color: #22aa44;">"</span><span style="color: #225588;"><<</span><span style="color: #6688cc;">endl;</span><span style="color: #6688cc;">cout</span><span style="color: #225588;"><<</span>
<span
style="color: #22aa44;">"</span><span style="color: #f280d0;">\n</span><span style="color: #22aa44;"> 'And' ** '&&' operator, both conditions must be true or else false"</span><span style="color: #225588;"><<</span>
<span
style="color: #6688cc;">endl;</span><span style="color: #6688cc;">cout</span><span style="color: #225588;"><<</span><span style="color: #22aa44;">"</span><span style="color: #f280d0;">\n</span><span style="color: #22aa44;"> bool b1, b2, b3 </span>
<span
style="color: #f280d0;">\n</span><span style="color: #22aa44;">"</span><span style="color: #225588;"><<</span><span style="color: #6688cc;">endl;</span><span style="color: #6688cc;">cout</span><span style="color: #225588;"><<</span>
<span
style="color: #22aa44;">"</span><span style="color: #f280d0;">\n</span><span style="color: #22aa44;"> ** = true, b2 = false, b3 = b1 && b2 = false </span><span style="color: #f280d0;">\n</span>
<span
style="color: #22aa44;">"</span><span style="color: #225588;"><<</span><span style="color: #6688cc;">endl;</span><span style="color: #6688cc;">cout</span><span style="color: #225588;"><<</span><span style="color: #22aa44;">"</span>
<span
style="color: #f280d0;">\n</span><span style="color: #22aa44;"> ** = true, b2 = false, b3 = b1 && !b2 = true </span><span style="color: #f280d0;">\n</span><span style="color: #22aa44;">"</span>
<span
style="color: #225588;"><<</span><span style="color: #6688cc;">endl;</span><span style="color: #6688cc;">cout</span><span style="color: #225588;"><<</span><span style="color: #22aa44;">"</span>
<span
style="color: #f280d0;">\n</span><span style="color: #22aa44;"> 'Or' '||' operator </span><span style="color: #f280d0;">\n</span><span style="color: #22aa44;">"</span><span style="color: #225588;"><<</span>
<span
style="color: #6688cc;">endl;</span><span style="color: #6688cc;">cout</span><span style="color: #225588;"><<</span><span style="color: #22aa44;">"</span><span style="color: #f280d0;">\n</span>
<span
style="color: #22aa44;"> If **** are False then they are false, if only one is true, hen the bool is true. </span><span style="color: #f280d0;">\n</span><span style="color: #22aa44;">"</span>
<span
style="color: #225588;"><<</span><span style="color: #6688cc;">endl;</span><span style="color: #6688cc;">cout</span><span style="color: #225588;"><<</span><span style="color: #22aa44;">"</span>
<span
style="color: #f280d0;">\n</span><span style="color: #22aa44;"> **** b1, b2, b3 </span><span style="color: #f280d0;">\n</span><span style="color: #22aa44;">"</span>
<span
style="color: #225588;"><<</span><span style="color: #6688cc;">endl;</span><span style="color: #6688cc;">cout</span><span style="color: #225588;"><<</span><span style="color: #22aa44;">"</span>
<span
style="color: #f280d0;">\n</span><span style="color: #22aa44;"> b1 = false; b2 = b1 || !b1; ** b2 = true </span><span style="color: #f280d0;">\n</span>
<span
style="color: #22aa44;">"</span><span style="color: #225588;"><<</span><span style="color: #6688cc;">endl;</span><span style="color: #6688cc;">cout</span><span style="color: #225588;"><<</span>
<span
style="color: #22aa44;">"</span><span style="color: #f280d0;">\n</span><span style="color: #22aa44;"> b3 = b2 && (b1 || true); so b3 = true </span>
<span
style="color: #f280d0;">\n</span><span style="color: #22aa44;">"</span><span style="color: #225588;"><<</span><span style="color: #6688cc;">endl;</span><br />
<span
style="color: #6688cc;">cout</span><span style="color: #225588;"><<</span><span style="color: #22aa44;">"</span><span style="color: #f280d0;">\n</span>
<span
style="color: #22aa44;"> ****** Bollean Expression , **** literals **** , false. </span><span style="color: #f280d0;">\n</span><span style="color: #22aa44;">"</span>
<span
style="color: #225588;"><<</span><span style="color: #6688cc;">endl;</span></div>
<div style="color: #6688cc; background-color: #000c18; font-family: Consolas, 'Courier New', monospace; font-weight: normal; font-size: 19px; line-height: 1.5; white-space: pre;"><span style="color: #6688cc;">cout</span><span style="color: #225588;"><<</span><span style="color: #22aa44;">"</span><span style="color: #f280d0;">\n</span><span style="color: #22aa44;"> Atomic Bollean ********** , arithmetic expressions using ********** operators, <, >, <=, >= etc. </span>
<span
style="color: #f280d0;">\n</span><span style="color: #22aa44;">"</span><span style="color: #225588;"><<</span><span style="color: #6688cc;">endl;</span><span style="color: #6688cc;">cout</span><span style="color: #225588;"><<</span><span style="color: #22aa44;">"</span>
<span
style="color: #f280d0;">\n</span><span style="color: #22aa44;"> Compound Bollean Expressions, simple ******* expressions combined with bollean operators - &&, ||, ! etc . </span><span style="color: #f280d0;">\n</span><span style="color: #22aa44;">"</span>
<span
style="color: #225588;"><<</span><span style="color: #6688cc;">endl;</span><span style="color: #6688cc;">cout</span><span style="color: #225588;"><<</span><span style="color: #22aa44;">"</span><span style="color: #f280d0;">\n</span><span style="color: #22aa44;"> b = true; (atomic),</span>
<span
style="color: #f280d0;">\n</span><span style="color: #22aa44;"> b = (true && !b); (compound ) , so b = false </span><span style="color: #f280d0;">\n</span><span style="color: #22aa44;">"</span><span style="color: #225588;"><<</span>
<span
style="color: #6688cc;">endl;</span><span style="color: #6688cc;">cout</span><span style="color: #225588;"><<</span><span style="color: #22aa44;">"</span><span style="color: #f280d0;">\n</span><span style="color: #22aa44;"> x = 3; b = (x < 5); so b = true , arithmetic expressions using relational ******** </span>
<span
style="color: #f280d0;">\n</span><span style="color: #22aa44;">"</span><span style="color: #225588;"><<</span><span style="color: #6688cc;">endl;</span><span style="color: #6688cc;">cout</span><span style="color: #225588;"><<</span>
<span
style="color: #22aa44;">"</span><span style="color: #f280d0;">\n</span><span style="color: #22aa44;"> b = (x >=0) && (x < 5); ** b = true </span><span style="color: #f280d0;">\n</span><span style="color: #22aa44;">"</span>
<span
style="color: #225588;"><<</span><span style="color: #6688cc;">endl;</span><span style="color: #6688cc;">cout</span><span style="color: #225588;"><<</span><span style="color: #22aa44;">"</span><span style="color: #f280d0;">\n</span>
<span
style="color: #22aa44;"> ***** equality by '==', and '!=' is not equal. </span><span style="color: #f280d0;">\n</span><span style="color: #22aa44;">"</span><span style="color: #225588;"><<</span><span style="color: #6688cc;">endl;</span>
<span
style="color: #6688cc;">cout</span><span style="color: #225588;"><<</span><span style="color: #22aa44;">"</span><span style="color: #f280d0;">\n</span><span style="color: #22aa44;"> b = (x==3) || (x==4); so b =true </span>
<span
style="color: #f280d0;">\n</span><span style="color: #22aa44;">"</span><span style="color: #225588;"><<</span><span style="color: #6688cc;">endl;</span><br /><span style="color: #6688cc;">cout</span><span style="color: #225588;"><<</span>
<span
style="color: #22aa44;">"</span><span style="color: #f280d0;">\n</span><span style="color: #22aa44;"> float vs. double .The precision of a floating ***** value indicates *** many digits the value can have after the ******* point. The precision of float is only *** or seven decimal digits, while double variables have a precision of about 15 digits. Therefore it is safer to use double for most calculations. </span>
<span
style="color: #f280d0;">\n</span><span style="color: #22aa44;">"</span><span style="color: #225588;"><<</span><span style="color: #6688cc;">endl;</span><br /><span style="color: #9966b8; font-style: italic;">float</span>
<span
style="color: #6688cc;"> f1 </span><span style="color: #225588;">=</span><span style="color: #6688cc;"> </span><span style="color: #f280d0;">35</span><span style="color: #225588;">e</span><span style="color: #f280d0;">3</span>
<span
style="color: #6688cc;">;</span><span style="color: #9966b8; font-style: italic;">double</span><span style="color: #6688cc;"> d1 </span><span style="color: #225588;">=</span><span style="color: #6688cc;"> </span>
<span
style="color: #f280d0;">12</span><span style="color: #225588;">E</span><span style="color: #f280d0;">4</span><span style="color: #6688cc;">;</span><span style="color: #6688cc;">cout</span><span style="color: #225588;"><<</span>
<span
style="color: #22aa44;">"</span><span style="color: #f280d0;">\n</span><span style="color: #22aa44;"> float f1 = 35e3; so f1 = "</span><span style="color: #6688cc;"> </span><span style="color: #225588;"><<</span>
<span
style="color: #6688cc;"> f1;</span><span style="color: #6688cc;">cout </span><span style="color: #225588;"><<</span><span style="color: #22aa44;">"</span><span style="color: #f280d0;">\n</span>
<span
style="color: #22aa44;"> double d1 = 12E4; so d1 = "</span><span style="color: #6688cc;"> </span><span style="color: #225588;"><<</span><span style="color: #6688cc;"> d1;</span>
<span
style="color: #6688cc;"> cout </span><span style="color: #225588;"><<</span><span style="color: #22aa44;">"Scientific Numbers: A floating point number can also be a scientific number with an 'e' to indicate the power of 10:</span>
<span
style="color: #f280d0;">\n</span><span style="color: #22aa44;">"</span><span style="color: #6688cc;">;</span><span style="color: #6688cc;"> </span><span style="color: #6688cc;"> cout </span>
<span
style="color: #225588;"><<</span><span style="color: #22aa44;">"***** f1 = 35e3; double d1 = 12E4; **** << ** << </span><span style="color: #f280d0;">\n</span>
<span
style="color: #22aa44;">; cout << d1;</span><span style="color: #f280d0;">\n</span><span style="color: #22aa44;">"</span><span style="color: #6688cc;">;</span>
<span
style="color: #6688cc;"> </span><span style="color: #6688cc;"> </span><span style="color: #9966b8; font-style: italic;">float</span><span style="color: #6688cc;"> f1 </span>
<span
style="color: #225588;">=</span><span style="color: #6688cc;"> </span><span style="color: #f280d0;">35</span><span style="color: #225588;">e</span><span style="color: #f280d0;">3</span>
<span
style="color: #6688cc;">;</span><span style="color: #6688cc;"> </span><span style="color: #9966b8; font-style: italic;">double</span><span style="color: #6688cc;"> d1 </span>
<span
style="color: #225588;">=</span><span style="color: #6688cc;"> </span><span style="color: #f280d0;">12</span><span style="color: #225588;">E</span><span style="color: #f280d0;">4</span>
<span
style="color: #6688cc;">;</span><span style="color: #6688cc;"> cout</span><span style="color: #225588;"><<</span><span style="color: #6688cc;"> </span>
<span
style="color: #22aa44;">"</span><span style="color: #f280d0;">\n</span><span style="color: #22aa44;">"</span><span style="color: #6688cc;"> </span>
<span
style="color: #225588;"><<</span><span style="color: #6688cc;"> f1 </span><span style="color: #225588;"><<</span><span style="color: #6688cc;"> </span>
<span
style="color: #22aa44;">"</span><span style="color: #f280d0;">\n</span><span style="color: #22aa44;">"</span><span style="color: #6688cc;">;</span>
<span
style="color: #6688cc;"> cout </span><span style="color: #225588;"><<</span><span style="color: #6688cc;"> </span>
<span
style="color: #22aa44;">"</span><span style="color: #f280d0;">\n</span><span style="color: #22aa44;">"</span><span style="color: #225588;"><<</span>
<span
style="color: #6688cc;"> d1;</span><br /><br /><span style="color: #6688cc;">cout</span><span style="color: #225588;"><<</span>
<span
style="color: #22aa44;">"</span><span style="color: #f280d0;">\n</span><span style="color: #22aa44;"> Boolean Types. A ******* data type ** declared with the bool keyword *** can only take the values true or false. When the value ** returned, true = 1 and ***** = 0. </span>
<span
style="color: #f280d0;">\n</span><span style="color: #22aa44;">"</span><span style="color: #225588;"><<</span><span style="color: #6688cc;">endl;</span><br
/><span style="color: #9966b8; font-style: italic;">bool</span><span style="color: #6688cc;"> isCodingFun </span>
<span
style="color: #225588;">=</span><span style="color: #6688cc;"> </span><span style="color: #f280d0;">true</span>
<span
style="color: #6688cc;">;</span><span style="color: #9966b8; font-style: italic;">bool</span><span style="color: #6688cc;"> isFishTasty </span>
<span
style="color: #225588;">=</span><span style="color: #6688cc;"> </span><span style="color: #f280d0;">false</span>
<span
style="color: #6688cc;">;</span><span style="color: #6688cc;">cout </span><span style="color: #225588;"><<</span>
<span
style="color: #6688cc;"> isCodingFun;</span><span style="color: #384887;"> // ******* 1 (true)</span>
<span
style="color: #6688cc;">cout </span><span style="color: #225588;"><<</span><span style="color: #6688cc;"> isFishTasty;</span>
<span
style="color: #384887;"> // Outputs 0 (false)</span><span style="color: #6688cc;">cout</span>
<span
style="color: #225588;"><<</span><span style="color: #22aa44;">"</span><span style="color: #f280d0;">\n</span>
<span
style="color: #22aa44;"> bool isCodingFun = true; bool isFishTasty = false; cout
<< isCodingFun; // Outputs 1 (true) cout <<
isFishTasty; // Outputs 0 (false) . Boolean values are
mostly used for conditional testing.</span><span style="color: #f280d0;">\n</span>
<span
style="color: #22aa44;">"</span><span style="color: #225588;"><<</span>
<span
style="color: #6688cc;">endl;</span><br /><br /><span style="color: #6688cc;">cout</span>
<span
style="color: #225588;"><<</span><span style="color: #22aa44;">"</span>
<span
style="color: #f280d0;">\n</span><span style="color: #22aa44;"> Character Types: The char data type is used to store a single</span></div>
<div style="color: #6688cc; background-color: #000c18; font-family: Consolas, 'Courier New', monospace; font-weight: normal; font-size: 19px; line-height: 1.5; white-space: pre;"><span style="color: #22aa44;"> character. The ********* **** be surrounded by ****** quotes, like 'A' or </span></div>
<div style="color: #6688cc; background-color: #000c18; font-family: Consolas, 'Courier New', monospace; font-weight: normal; font-size: 19px; line-height: 1.5; white-space: pre;"><span style="color: #22aa44;">'c': </span><span style="color: #f280d0;">\n</span><span style="color: #22aa44;">"</span><span style="color: #225588;"><<</span><span style="color: #6688cc;">endl;</span><span style="color: #6688cc;">cout</span>
<span
style="color: #225588;"><<</span><span style="color: #22aa44;">"</span><span style="color: #f280d0;">\n</span><span style="color: #22aa44;"> char myGrade = 'B'; cout << myGrade<<endl;char a = 65, b = 66, c = 67;cout << a <<endl;cout << b <<endl; cout << c <<endl; </span>
<span
style="color: #f280d0;">\n</span><span style="color: #22aa44;">"</span><span style="color: #225588;"><<</span><span style="color: #6688cc;">endl;</span><span style="color: #6688cc;"> </span><span style="color: #9966b8; font-style: italic;">char</span>
<span
style="color: #6688cc;"> myGrade </span><span style="color: #225588;">=</span><span style="color: #6688cc;"> </span><span style="color: #22aa44;">'B'</span><span style="color: #6688cc;">;</span><span style="color: #6688cc;"> cout </span>
<span
style="color: #225588;"><<</span><span style="color: #6688cc;"> myGrade</span><span style="color: #225588;"><<</span><span style="color: #6688cc;">endl;</span><span style="color: #6688cc;"> </span><span style="color: #9966b8; font-style: italic;">char</span>
<span
style="color: #6688cc;"> a </span><span style="color: #225588;">=</span><span style="color: #6688cc;"> </span><span style="color: #f280d0;">65</span><span style="color: #6688cc;">, b </span><span style="color: #225588;">=</span>
<span
style="color: #6688cc;"> </span><span style="color: #f280d0;">66</span><span style="color: #6688cc;">, c </span><span style="color: #225588;">=</span><span style="color: #6688cc;"> </span><span style="color: #f280d0;">67</span>
<span
style="color: #6688cc;">;</span><span style="color: #6688cc;"> cout </span><span style="color: #225588;"><<</span><span style="color: #6688cc;"> a </span><span style="color: #225588;"><<</span><span style="color: #6688cc;">endl;</span>
<span
style="color: #6688cc;"> cout </span><span style="color: #225588;"><<</span><span style="color: #6688cc;"> b </span><span style="color: #225588;"><<</span><span style="color: #6688cc;">endl;</span>
<span
style="color: #6688cc;"> cout </span><span style="color: #225588;"><<</span><span style="color: #6688cc;"> c </span><span style="color: #225588;"><<</span><span style="color: #6688cc;">endl;</span><br
/><span style="color: #6688cc;"> cout</span><span style="color: #225588;"><<</span><span style="color: #22aa44;">"</span><span style="color: #f280d0;">\n</span><span style="color: #22aa44;"> Here we will see *** ** print some floating point numbers up </span></div>
<div style="color: #6688cc; background-color: #000c18; font-family: Consolas, 'Courier New', monospace; font-weight: normal; font-size: 19px; line-height: 1.5; white-space: pre;"><span style="color: #22aa44;">to some pre-defined decimal places. In C++, ** can use setprecision with the **** to do this word. This is present ***** the iomanip header **** in C++, #include <iomanip>."</span><span style="color: #225588;"><<</span>
<span
style="color: #6688cc;">endl;</span><br /><br /><span style="color: #6688cc;"> </span><span style="color: #9966b8; font-style: italic;">double</span><span style="color: #6688cc;"> x </span><span style="color: #225588;">=</span><span style="color: #6688cc;"> </span>
<span
style="color: #f280d0;">2.3654789</span><span style="color: #225588;">d</span><span style="color: #6688cc;">;</span><span style="color: #6688cc;"> </span></div>
<div style="color: #6688cc; background-color: #000c18; font-family: Consolas, 'Courier New', monospace; font-weight: normal; font-size: 19px; line-height: 1.5; white-space: pre;"><span style="color: #6688cc;"> cout </span><span style="color: #225588;"><<</span><span style="color: #6688cc;"> </span><span style="color: #22aa44;">"Print up to 3 decimal places: "</span>
<span
style="color: #6688cc;"> </span><span style="color: #225588;"><<</span><span style="color: #6688cc;"> </span><span style="color: #ddbb88;">setprecision</span><span style="color: #6688cc;">(</span><span style="color: #f280d0;">3</span><span style="color: #6688cc;">) </span>
<span
style="color: #225588;"><<</span><span style="color: #6688cc;"> x </span><span style="color: #225588;"><<</span><span style="color: #6688cc;"> endl;</span></div>
<div style="color: #6688cc; background-color: #000c18; font-family: Consolas, 'Courier New', monospace; font-weight: normal; font-size: 19px; line-height: 1.5; white-space: pre;"> </div>
<div style="color: #6688cc; background-color: #000c18; font-family: Consolas, 'Courier New', monospace; font-weight: normal; font-size: 19px; line-height: 1.5; white-space: pre;"><span style="color: #6688cc;"> cout </span><span style="color: #225588;"><<</span><span style="color: #6688cc;"> </span><span style="color: #22aa44;">"Print up to 2 decimal places: "</span>
<span
style="color: #6688cc;"> </span><span style="color: #225588;"><<</span><span style="color: #6688cc;"> </span><span style="color: #ddbb88;">setprecision</span><span style="color: #6688cc;">(</span><span style="color: #f280d0;">2</span><span style="color: #6688cc;">) </span>
<span
style="color: #225588;"><<</span><span style="color: #6688cc;"> x </span><span style="color: #225588;"><<</span><span style="color: #6688cc;"> endl;</span></div>
<div style="color: #6688cc; background-color: #000c18; font-family: Consolas, 'Courier New', monospace; font-weight: normal; font-size: 19px; line-height: 1.5; white-space: pre;"><span style="color: #6688cc;"> cout </span><span style="color: #225588;"><<</span><span style="color: #6688cc;"> </span><span style="color: #22aa44;">"Print up to 7 decimal places: "</span>
<span
style="color: #6688cc;"> </span><span style="color: #225588;"><<</span><span style="color: #6688cc;"> </span><span style="color: #ddbb88;">setprecision</span><span style="color: #6688cc;">(</span><span style="color: #f280d0;">7</span><span style="color: #6688cc;">) </span>
<span
style="color: #225588;"><<</span><span style="color: #6688cc;"> x </span><span style="color: #225588;"><<</span><span style="color: #6688cc;"> endl;</span></div>
<div style="color: #6688cc; background-color: #000c18; font-family: Consolas, 'Courier New', monospace; font-weight: normal; font-size: 19px; line-height: 1.5; white-space: pre;"><span style="color: #6688cc;">cout</span><span style="color: #225588;"><<</span><span style="color: #22aa44;">"</span><span style="color: #f280d0;">\n</span><span style="color: #22aa44;"> /* setprecision(n) applies to the entire number, not *** fractional</span></div>
<div style="color: #6688cc; background-color: #000c18; font-family: Consolas, 'Courier New', monospace; font-weight: normal; font-size: 19px; line-height: 1.5; white-space: pre;"><span style="color: #22aa44;"> part. You need to use the fixed-point format to make it ***** to the fractional part: setiosflags(ios::fixed)*/ "</span><span style="color: #225588;"><<</span><span style="color: #6688cc;">endl;</span><br />
<span
style="color: #6688cc;">cout</span><span style="color: #225588;"><<</span><span style="color: #22aa44;">"</span><span style="color: #f280d0;">\n</span><span style="color: #22aa44;"> // You have to set the '***** mode' to fixed."</span><span style="color: #225588;"><<</span>
<span
style="color: #6688cc;">endl;</span><span style="color: #6688cc;"> </span></div>
<div style="color: #6688cc; background-color: #000c18; font-family: Consolas, 'Courier New', monospace; font-weight: normal; font-size: 19px; line-height: 1.5; white-space: pre;"><span style="color: #6688cc;"> </span><span style="color: #9966b8; font-style: italic;">double</span><span style="color: #6688cc;"> d </span><span style="color: #225588;">=</span><span style="color: #6688cc;"> </span>
<span
style="color: #f280d0;">122.345</span><span style="color: #6688cc;">;</span><span style="color: #6688cc;"> cout </span><span style="color: #225588;"><<</span><span style="color: #6688cc;"> fixed </span><span style="color: #225588;"><<</span>
<span
style="color: #6688cc;"> </span><span style="color: #ddbb88;">setprecision</span><span style="color: #6688cc;">(</span><span style="color: #f280d0;">2</span><span style="color: #6688cc;">) </span><span style="color: #225588;"><<</span><span style="color: #6688cc;"> d</span>
<span
style="color: #225588;"><<</span><span style="color: #6688cc;">endl; </span><span style="color: #384887;"> </span></div>
<div style="color: #6688cc; background-color: #000c18; font-family: Consolas, 'Courier New', monospace; font-weight: normal; font-size: 19px; line-height: 1.5; white-space: pre;"><span style="color: #384887;"> // ******** point ********** example</span><span style="color: #6688cc;"> </span></div>
<div style="color: #6688cc; background-color: #000c18; font-family: Consolas, 'Courier New', monospace; font-weight: normal; font-size: 19px; line-height: 1.5; white-space: pre;"><span style="color: #6688cc;">cout </span><span style="color: #225588;"><<</span><span style="color: #6688cc;"> fixed </span><span style="color: #225588;"><<</span><span style="color: #6688cc;"> </span><span style="color: #ddbb88;">setprecision</span>
<span
style="color: #6688cc;">(</span><span style="color: #f280d0;">2</span><span style="color: #6688cc;">) </span><span style="color: #225588;"><<</span><span style="color: #6688cc;"> </span><span style="color: #f280d0;">122.345</span><span style="color: #6688cc;"> </span>
<span
style="color: #225588;"><<</span><span style="color: #6688cc;"> endl;</span><span style="color: #384887;"> // Output: 122.34</span><br /><span style="color: #384887;"> // integer formatting example</span>
<span
style="color: #6688cc;"> </span>
</div>
<div style="color: #6688cc; background-color: #000c18; font-family: Consolas, 'Courier New', monospace; font-weight: normal; font-size: 19px; line-height: 1.5; white-space: pre;"><span style="color: #6688cc;">cout </span><span style="color: #225588;"><<</span><span style="color: #6688cc;"> fixed </span><span style="color: #225588;"><<</span><span style="color: #6688cc;"> </span><span style="color: #ddbb88;">setprecision</span>
<span
style="color: #6688cc;">(</span><span style="color: #f280d0;">2</span><span style="color: #6688cc;">) </span><span style="color: #225588;"><<</span><span style="color: #6688cc;"> </span><span style="color: #9966b8; font-style: italic;">double</span>
<span
style="color: #6688cc;">(</span><span style="color: #f280d0;">122</span><span style="color: #6688cc;">) </span><span style="color: #225588;"><<</span><span style="color: #6688cc;"> endl;</span><span style="color: #384887;"> // Output: 122.00</span><br
/><span style="color: #6688cc;">cout</span><span style="color: #225588;"><<</span><span style="color: #22aa44;">"</span><span style="color: #f280d0;">\n</span><span style="color: #22aa44;"> Branching Statements, if, if else, if if if, if else if else"</span>
<span
style="color: #225588;"><<</span><span style="color: #6688cc;">endl;</span></div>
<div style="color: #6688cc; background-color: #000c18; font-family: Consolas, 'Courier New', monospace; font-weight: normal; font-size: 19px; line-height: 1.5; white-space: pre;"><span style="color: #6688cc;">cout</span><span style="color: #225588;"><<</span><span style="color: #22aa44;">"</span><span style="color: #f280d0;">\n</span><span style="color: #22aa44;"> one way if statement "</span><span style="color: #225588;"><<</span>
<span
style="color: #6688cc;">endl;</span><br /><span style="color: #6688cc;">cout</span><span style="color: #225588;"><<</span><span style="color: #22aa44;">"</span><span style="color: #f280d0;">\n</span><span style="color: #22aa44;"> Computing Absolute Values "</span>
<span
style="color: #225588;"><<</span><span style="color: #6688cc;">endl;</span><br /><span style="color: #6688cc;">cout</span><span style="color: #225588;"><<</span><span style="color: #22aa44;">"</span><span style="color: #f280d0;">\n</span><span style="color: #22aa44;"> Please enter a value ** get its absolute value "</span>
<span
style="color: #225588;"><<</span><span style="color: #6688cc;">endl;</span><br /><span style="color: #9966b8; font-style: italic;">int</span><span style="color: #6688cc;"> UI11;</span><span style="color: #6688cc;">cin</span><span style="color: #225588;">>></span>
<span
style="color: #6688cc;"> UI11;</span><br /><span style="color: #225588;">if</span><span style="color: #6688cc;"> ( UI11 </span><span style="color: #225588;"><</span><span style="color: #6688cc;"> </span><span style="color: #f280d0;">0</span>
<span
style="color: #6688cc;">)</span><span style="color: #6688cc;"> UI11 </span><span style="color: #225588;">*=</span><span style="color: #6688cc;"> (</span><span style="color: #225588;">-</span><span style="color: #f280d0;">1</span>
<span
style="color: #6688cc;">);</span><span style="color: #384887;"> //UI11 *= UI11 * (-1);</span><br /><span style="color: #6688cc;">cout</span><span style="color: #225588;"><<</span><span style="color: #22aa44;">"</span><span style="color: #f280d0;">\n</span>
<span
style="color: #22aa44;"> Absolute value is "</span><span style="color: #225588;"><<</span><span style="color: #6688cc;"> UI11</span><span style="color: #225588;"><<</span><span style="color: #6688cc;">endl;</span><br
/><br /><span style="color: #6688cc;">cout</span><span style="color: #225588;"><<</span><span style="color: #22aa44;">"</span><span style="color: #f280d0;">\n</span><span style="color: #22aa44;"> Determine Even or Odd "</span>
<span
style="color: #225588;"><<</span><span style="color: #6688cc;">endl;</span><br /><span style="color: #6688cc;">cout</span><span style="color: #225588;"><<</span><span style="color: #22aa44;">"</span><span style="color: #f280d0;">\n</span>
<span
style="color: #22aa44;"> Please ***** a positive integer Value "</span><span style="color: #225588;"><<</span><span style="color: #6688cc;">endl;</span><br /><span style="color: #9966b8; font-style: italic;">int</span>
<span
style="color: #6688cc;"> UI12 ;</span><span style="color: #6688cc;">cin</span><span style="color: #225588;">>></span><span style="color: #6688cc;"> UI12 ;</span><span style="color: #225588;">if</span><span style="color: #6688cc;"> (UI12 </span>
<span
style="color: #225588;">%</span><span style="color: #6688cc;"> </span><span style="color: #f280d0;">2</span><span style="color: #6688cc;"> </span><span style="color: #225588;">==</span><span style="color: #6688cc;"> </span>
<span
style="color: #f280d0;">0</span><span style="color: #6688cc;">) </span><span style="color: #6688cc;"> cout</span><span style="color: #225588;"><<</span><span style="color: #6688cc;"> UI12 </span>
<span
style="color: #225588;"><<</span><span style="color: #6688cc;"> </span><span style="color: #22aa44;">" is a even </span></div>
<div style="color: #6688cc; background-color: #000c18; font-family: Consolas, 'Courier New', monospace; font-weight: normal; font-size: 19px; line-height: 1.5; white-space: pre;"><span style="color: #22aa44;">number "</span><span style="color: #225588;"><<</span><span style="color: #6688cc;">endl;</span><span style="color: #6688cc;"> </span><span style="color: #225588;">if</span><span style="color: #6688cc;"> (UI12 </span>
<span
style="color: #225588;">%</span><span style="color: #6688cc;"> </span><span style="color: #f280d0;">2</span><span style="color: #6688cc;"> </span><span style="color: #225588;">==</span><span style="color: #6688cc;"> </span><span style="color: #f280d0;">1</span>
<span
style="color: #6688cc;">) </span><span style="color: #6688cc;"> cout</span><span style="color: #225588;"><<</span><span style="color: #6688cc;"> UI12 </span><span style="color: #225588;"><<</span><span style="color: #6688cc;"> </span>
<span
style="color: #22aa44;">" is a odd number "</span><span style="color: #225588;"><<</span><span style="color: #6688cc;">endl;</span><br /><br /><br /><br /><span style="color: #6688cc;">cout</span><span style="color: #225588;"><<</span>
<span
style="color: #22aa44;">"</span><span style="color: #f280d0;">\n</span><span style="color: #22aa44;"> ********* Even or Odd "</span><span style="color: #225588;"><<</span><span style="color: #6688cc;">endl;</span><span style="color: #6688cc;">cout</span>
<span
style="color: #225588;"><<</span><span style="color: #22aa44;">"</span><span style="color: #f280d0;">\n</span><span style="color: #22aa44;"> Please enter a</span></div>
<div style="color: #6688cc; background-color: #000c18; font-family: Consolas, 'Courier New', monospace; font-weight: normal; font-size: 19px; line-height: 1.5; white-space: pre;"><span style="color: #22aa44;"> integer Value "</span><span style="color: #225588;"><<</span><span style="color: #6688cc;">endl;</span><br /><br /><span style="color: #9966b8; font-style: italic;">int</span><span style="color: #6688cc;"> UI1 ;</span>
<span
style="color: #6688cc;">cin</span><span style="color: #225588;">>></span><span style="color: #6688cc;"> UI1 ;</span><br /><span style="color: #9966b8; font-style: italic;">int</span><span style="color: #6688cc;"> UI2 </span><span style="color: #225588;">=</span>
<span
style="color: #6688cc;"> UI1;</span><br /><span style="color: #225588;">if</span><span style="color: #6688cc;"> ( UI1 </span><span style="color: #225588;"><</span><span style="color: #6688cc;"> </span><span style="color: #f280d0;">0</span>
<span
style="color: #6688cc;">)</span><span style="color: #6688cc;">{</span><span style="color: #6688cc;"> UI2 </span><span style="color: #225588;">=</span><span style="color: #6688cc;"> UI1 </span><span style="color: #225588;">*</span>
<span
style="color: #6688cc;"> (</span><span style="color: #225588;">-</span><span style="color: #f280d0;">1</span><span style="color: #6688cc;">);</span><span style="color: #6688cc;"> cout</span><span style="color: #225588;"><<</span>
<span
style="color: #6688cc;"> UI1</span><span style="color: #225588;"><<</span><span style="color: #6688cc;"> </span><span style="color: #22aa44;">" is a negative </span></div>
<div style="color: #6688cc; background-color: #000c18; font-family: Consolas, 'Courier New', monospace; font-weight: normal; font-size: 19px; line-height: 1.5; white-space: pre;"><span style="color: #22aa44;">number "</span><span style="color: #225588;"><<</span><span style="color: #6688cc;">endl;</span><span style="color: #6688cc;"> cout</span><span style="color: #225588;"><<</span>
<span
style="color: #6688cc;"> </span><span style="color: #22aa44;">" Absolute value of "</span><span style="color: #225588;"><<</span><span style="color: #6688cc;"> UI1</span><span style="color: #225588;"><<</span><span style="color: #6688cc;"> </span>
<span
style="color: #22aa44;">" is |"</span><span style="color: #225588;"><<</span><span style="color: #6688cc;"> UI1</span><span style="color: #225588;"><<</span><span style="color: #6688cc;"> </span><span style="color: #22aa44;">"| ="</span>
<span
style="color: #225588;"><<</span><span style="color: #6688cc;"> UI2 </span><span style="color: #225588;"><<</span><span style="color: #6688cc;">endl;</span><span style="color: #6688cc;">}</span><span style="color: #384887;"> // compound if () multi instruction need {}</span><br
/><br /><span style="color: #225588;">else</span><span style="color: #6688cc;"> </span><span style="color: #6688cc;"> cout</span><span style="color: #225588;"><<</span><span style="color: #6688cc;"> UI1</span>
<span
style="color: #225588;"><<</span><span style="color: #6688cc;"> </span><span style="color: #22aa44;">" is a positive number "</span><span style="color: #225588;"><<</span><span style="color: #6688cc;">endl; </span>
<span
style="color: #384887;"> // simple one instruction else does not need {}</span><br /><span style="color: #225588;">if</span><span style="color: #6688cc;"> (UI2 </span><span style="color: #225588;">%</span><span style="color: #6688cc;"> </span>
<span
style="color: #f280d0;">2</span><span style="color: #6688cc;"> </span><span style="color: #225588;">==</span><span style="color: #6688cc;"> </span><span style="color: #f280d0;">0</span><span style="color: #6688cc;">) </span>
<span
style="color: #6688cc;"> cout</span><span style="color: #225588;"><<</span><span style="color: #6688cc;"> UI1</span><span style="color: #225588;"><<</span><span style="color: #6688cc;"> </span><span style="color: #22aa44;">" is a even number "</span>
<span
style="color: #225588;"><<</span><span style="color: #6688cc;">endl;</span><span style="color: #384887;"> // simple one instruction does not need {}</span><span style="color: #6688cc;"> </span><span style="color: #225588;">else</span>
<span
style="color: #6688cc;"> </span><span style="color: #6688cc;"> cout</span><span style="color: #225588;"><<</span><span style="color: #6688cc;"> UI1</span><span style="color: #225588;"><<</span>
<span
style="color: #6688cc;"> </span><span style="color: #22aa44;">" is a odd number "</span><span style="color: #225588;"><<</span><span style="color: #6688cc;">endl;</span><span style="color: #384887;"> // simple one instruction does not need {}</span><br
/><span style="color: #6688cc;">cout</span><span style="color: #225588;"><<</span><span style="color: #6688cc;"> </span><span style="color: #22aa44;">"</span><span style="color: #f280d0;">\n </span>
<span
style="color: #22aa44;">Mod or Modulo operator % (1 % 2) = "</span><span style="color: #6688cc;"> </span><span style="color: #225588;"><<</span><span style="color: #6688cc;"> </span>
<span
style="color: #f280d0;">1</span><span style="color: #6688cc;"> </span><span style="color: #225588;">%</span><span style="color: #6688cc;"> </span><span style="color: #f280d0;">2</span><span style="color: #225588;"><<</span>
<span
style="color: #6688cc;"> </span><span style="color: #22aa44;">" and 0 % 2 = "</span><span style="color: #225588;"><<</span><span style="color: #6688cc;"> </span><span style="color: #f280d0;">0</span>
<span
style="color: #6688cc;"> </span><span style="color: #225588;">%</span><span style="color: #6688cc;"> </span><span style="color: #f280d0;">2</span><span style="color: #6688cc;"> </span><span style="color: #225588;"><<</span>
<span
style="color: #6688cc;">endl;</span><br /><span style="color: #384887;">/// output 1 % 2 = 1 and 0 % 2 = 0</span><br /><span style="color: #6688cc;">cout</span><span style="color: #225588;"><<</span>
<span
style="color: #22aa44;">"</span><span style="color: #f280d0;">\n</span><span style="color: #22aa44;"> There should be a boolean statement inside () of if </span></div>
<div style="color: #6688cc; background-color: #000c18; font-family: Consolas, 'Courier New', monospace; font-weight: normal; font-size: 19px; line-height: 1.5; white-space: pre;"><span style="color: #22aa44;">( ..boolean..); "</span><span style="color: #225588;"><<</span><span style="color: #6688cc;">endl;</span><span style="color: #6688cc;">cout</span><span style="color: #225588;"><<</span>
<span
style="color: #22aa44;">"</span><span style="color: #f280d0;">\n</span><span style="color: #22aa44;"> Arithmetic ********* inside ** </span></div>
<div style="color: #6688cc; background-color: #000c18; font-family: Consolas, 'Courier New', monospace; font-weight: normal; font-size: 19px; line-height: 1.5; white-space: pre;"><span style="color: #22aa44;"> if ( ..arithmetic..) **** give error. "</span><span style="color: #225588;"><<</span><span style="color: #6688cc;">endl;</span><br /><br /><span style="color: #6688cc;">cout</span><span style="color: #225588;"><<</span>
<span
style="color: #22aa44;">"</span><span style="color: #f280d0;">\n</span><span style="color: #22aa44;"> Check_Alphabate_Letter_Upper_Lower_Numeric_Digit with if()</span></div>
<div style="color: #6688cc; background-color: #000c18; font-family: Consolas, 'Courier New', monospace; font-weight: normal; font-size: 19px; line-height: 1.5; white-space: pre;"><span style="color: #22aa44;"> **** if "</span><span style="color: #225588;"><<</span><span style="color: #6688cc;">endl;</span><br /><span style="color: #6688cc;">cout</span><span style="color: #225588;"><<</span><span style="color: #22aa44;">"</span>
<span
style="color: #f280d0;">\n</span><span style="color: #22aa44;"> Please enter a Alphabate or Letter or Upper or ***** or</span></div>
<div style="color: #6688cc; background-color: #000c18; font-family: Consolas, 'Courier New', monospace; font-weight: normal; font-size: 19px; line-height: 1.5; white-space: pre;"><span style="color: #22aa44;"> Numeric or Digit "</span><span style="color: #225588;"><<</span><span style="color: #6688cc;">endl;</span><br /><span style="color: #9966b8; font-style: italic;">char</span><span style="color: #6688cc;"> UserInputChar;</span>
<span
style="color: #6688cc;">cin</span><span style="color: #225588;">>></span><span style="color: #6688cc;"> ************* ;</span><br /><span style="color: #225588;">if</span><span style="color: #6688cc;"> (UserInputChar </span><span style="color: #225588;">>=</span>
<span
style="color: #6688cc;"> </span><span style="color: #22aa44;">'a'</span><span style="color: #6688cc;"> </span><span style="color: #225588;">&&</span><span style="color: #6688cc;"> UserInputChar </span><span style="color: #225588;"><=</span>
<span
style="color: #6688cc;"> </span><span style="color: #22aa44;">'z'</span><span style="color: #6688cc;">)</span><span style="color: #384887;"> // 'a', 'A', .... are C++ ********* or char literals.</span><span style="color: #6688cc;"> cout</span>
<span
style="color: #225588;"><<</span><span style="color: #22aa44;">"</span><span style="color: #f280d0;">\n</span><span style="color: #22aa44;"> Your input "</span><span style="color: #225588;"><<</span><span style="color: #6688cc;"> UserInputChar</span>
<span
style="color: #225588;"><<</span><span style="color: #22aa44;">" is a lower case letter "</span><span style="color: #225588;"><<</span><span style="color: #6688cc;">endl;</span><span style="color: #225588;">else</span>