forked from vivekpatilpv/build
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1a345fe
commit 4c29bef
Showing
1 changed file
with
35 additions
and
0 deletions.
There are no files selected for viewing
35 changes: 35 additions & 0 deletions
35
basic-programming-questions/operators-loops-branching-questions.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
# 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 | ||
|
||
7. 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 ..... ` | ||
|
||
8. Print the following star pattern :- | ||
- \*\* | ||
*** | ||
*** | ||
*** | ||
9. Write a program to take a number input from user and print multiplication table 12 times for that number. | ||
|
||
10. Write a program to return a Fibonacci series : 0,1,1,2,3,5,8,13,21.... | ||
|
||
11. Write a program to take an input from a user and find its Factorial. | ||
`Example: Factorial of 5 is 120` | ||
12. Write a Program to take a number input from user and find if the number is Prime or not. | ||
|
||
13. Write a program to take a day as an input and determine whether it is a weekday or weekend. | ||
`Example: Tuesday is weekday.` |