Skip to content

Latest commit

 

History

History
40 lines (24 loc) · 1.69 KB

001_operators_branching_loops.md

File metadata and controls

40 lines (24 loc) · 1.69 KB

Operators, Branching, Loops

Easy

  1. Write a program to add 5 numbers. The value of numbers are num1=5, num2=13, num3=7, num4=21 and num5=48.

  2. Write a program to take a number input from user and determine whether the number is odd or even.

  3. Write a program to find the maximum and minimum out of two given numbers. The numbers are num1=129 and num2=251.

  4. Write a program to find the maximum out of three given numbers. The numbers are num1=8, num2=23 and num3=17.

  5. Write a program to find the minimum out of three given numbers. The numbers are num1=35, num2=29 and num3=46.

  6. Write program to take a month as an input from the user and find out whether the month has 31 days or not.

Intermediate

  1. Fizzbuzz - Write a program to return an array from 1 to 100. But for every multiple of 3, replace the number with "Fizz", for every multiple of 5, replace the number with "Buzz" and for every multiples of 3 & 5, replace with "FizzBuzz".

    Your output should look something like this 1, 2, Fizz, 4, Buzz, Fizz, 7, 8, Fizz, Buzz, 11, Fizz, 13, 14, FizzBuzz, 16, 17 .....

  2. Print the following star pattern :-

    *
    * *
    * * *
    * * * *
    * * * * *

  3. Write a program to take a number input from user and print multiplication table 12 times for that number.

  4. Write a program to return a Fibonacci series : 0,1,1,2,3,5,8,13,21....

  5. Write a program to take an input from a user and find its Factorial. Example: Factorial of 5 is 120

  6. Write a Program to take a number input from user and find if the number is Prime or not.

  7. Write a program to take a day as an input and determine whether it is a weekday or weekend. Example: Tuesday is weekday.