Loops

  1. Program for Factorial of N.
    Expected Output:
       Enter N: 5
       Factorial = 120
                           
  2. Program to print Table of N.
    Expected Output:
        Enter N: 5
        5 * 1 = 5
        5 * 2 = 10
        5 * 3 = 15
        5 * 4 = 20
        5 * 5 = 25
        5 * 6 = 30
        5 * 7 = 35
        5 * 8 = 40
        5 * 9 = 45
        5 * 10 = 50
            
                                    
  3. Program to Print square and Cube of each value up to N.
    Expected Output:
        Enter N:3
        
        1 -> 1 1
        2 -> 4 8
        3 -> 9 27
                                    
  4. Input price of N products and get their total and Avg.Price.
    Expected Output:
        Enter Products: 3
        Enter Price of 1 Product:500
        Enter Price of 2 Product:700
        Enter Price of 3 Product:900
        
        Total price : 2100
        Avg Price : 700
                                    
  5. Program to add all even and odd values seprately from 1 to N.
    Expected Output:
        Enter N: 4
        Sum of evens = 6
        Sum of odds = 4
        
                               
  6. Program to Show the following Output.
    Expected Output:
        1  4
        2  3
        3  2
        4  1
                                    
  7. Program to print following Output.
    Expected Output:
        * * * *
        * * *
        * *
        *
        
                               
  8. Program for following Output.
    Expected Output:
        65 66 67 68
        65 66 67
        65 66
        65
                                    
  9. Program for following Output.
    Expected Output:
        A B C D
        A B C 
        A B
        A
        
                               
  10. Program for following Output.
    Expected Output:
        1
        2 3
        4 5 6
        7 8 9 10
                                    
  11. Program for following Output.
    Expected Output:
        * * * 1
        * * 1 2
        * 1 2 3
        1 2 3 4
        
                               
  12. Program for following Output.
    Expected Output:
                *
             *     *
          *     *    *
        *    *     *    *
                                    
  13. Program to print factorial of N using while loop.
  14. Program to print and count Palindrome numbers from 11 to N.
    Expected Output:
        Enter N : 40
        Palindrome :11
        Palindrome :22
        Palindrome :33
        
        Palindrome Numbers Found : 3
        
                               
  15. Program for following Output.
    Expected Output:
        Enter any Number : 154
        
        Four Five One
        
                               
  16. Program to count No. of odd and even digits a number Contain.
    Expected Output:
        Enter any value : 12567
        
        No. of odd digits : 3
        No of even digits : 2
        
                               
  17. Program to print table of N using do-while loop.
  18. Program for palindrome number using do-while loop.