C++ Code Samples
A Better Snakes and Ladders (Saanp-Sidhi) Code in C++(C Plus Plus(cpp))
[crayon-5a2bba7b40480392876994/]
[crayon-5a2bba7b40480392876994/]
[crayon-5a2bba7b40ad3238299635/]
[crayon-5a2bba7b410bc347721882/] [crayon-5a2bba7b410c7954757763/]
Works only upto 3 digit number [crayon-5a2bba7b4130c105522040/]
What is a nasty number? Well it is a number whose four different factors can be arranged in such a way that sum of two is equal to difference of other two. Take an example of nasty number 36. It have factors 1,2,3,4,6,9,12,18. So, we have 2+1=6-3 . So, it Read more…
Note : Just for Knowledge and avoid using it. [crayon-5a2bba7b41752449265536/]
Note: Should not be used to for sorting large data. #include < stdio.h > #include < conio.h > #define size 20 // size of array void main() { int i, j, temp, elements[size], n; clrscr(); printf("Enter the number of elements\t"); // Enter the number of total elements Read more…
Which are armstrong numbers? Numbers whose sum of cube of digits is equal to the number itself. e.g. if we take 153 than 13 =1 53=125 33=27 and sum of all of them is 1+125+27=153 so 153 is a armstrong number. Code in c : #include < stdio.h > #include Read more…