Skip to content

Archa-Mohan/ArchaMohan_preWorkAssignmentSolutions

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 

Repository files navigation

Pre-Work Assignment Solution

Requirement

  • This program allows the user to select the functionality they need to perform and exit based on the input.

  • The different operations available are as follows:

    1. Checking if the input from the user is a palindrome number.
    2. Printing the pattern of stars in decreasing order based on the input number of levels.
    3. Checking whether the input number is a prime number or not.
    4. Printing Fibonacci series of size 'n' with first two numbers as 0, 1.
    5. To exit the program.

Working

  • On running the program, the options for the user are displayed on the console.

alt text

  • The option displayed have numbers one to four and number zero to exit. All other options are considered as "Invalid choice".

alt text

  • The user then selects the operation they need by entering the valid option number.
  • The user is then instructed to enter input based on the operation they are performing.
  • Once that operation is completed, the user returns to the first set of options.
  • They can select other operations or exit the program by selecting the option 0.

alt text

  • Using Switch case and do-While loop, based on the option selected by the user different functions are invoked.

Option 1 - Find palindrome of number

alt text

Option 2 - Print Pattern for a given number

alt text

alt text

Option 3 - Check whether the no is a prime number.

alt text

alt text

Option 4 - Print Fibonacci series.

alt text

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages