simple program for the fresher asked in interview
In the previous post i give you simple program that is asked in interview frequently and here the next part of that post in this post we will learn the use of while, repeat- while , for loop , switch and function. the below programs are very easy and these program should be know by the every computer science student who is fresher. To write these program i use the swift programming language and you can use any programming language with you familiar. These program are for the basic concept and increase the idea about programming and improve the idea. and improve the logic the program. (1) use of repeat-while loop to print count func count(num: Int )-> Int { var n = num var count = 0 repeat { n = n / 10 count = count + 1 } while (n > 0) return count } print ( count (num: 145000331)) Output:- 9 (2) use of the ...