Skip to main content

Posts

Showing posts with the label Programs to try using loops

Programs to try using loops

Loops 1)Print the even numbers between 0 and 50 (use while) 2)Print the odd numbers between 0 and 50 in the reverse order ( use while) 3)Print the series 5,10,15,….,100 (using for loop) 4)Generate the series 1, 2, 4 ,7, 11 ,16....n ( use while...read n) 5)Generate the Fibonacci series 0 1 1 2 3 5 8…..n ( use do while..read n) 6)Find the factorial of a number ( use for statement do not use built in factorial() function) 7)Print the powers of a number upto 10th power. ( Eg: if n=2 then the program should print 2^0, 2^1, 2^2,2^3,…..,2^10 use for loop) 8)Print the multiplication table of a given number. ( use while) 9)Print the numbers from 1 to 10 and their natural logarithms as a table ( use for) 10)Find the sum of the digits of a number.( use while-university question) 11)Check whether the given 3 digit number is an Armstrong number. (use do while Eg:153,370,371,407) ( uq) 12)Find the factors of a number ( use for) 13)Check whether the given number is prime or not ( use