practice for programmers
Logged in as Anonymous Student
273387 MAD 2562 - Variables, conditions, loops
Print "Hello Mor Nor" (without quotes).
Read in a number, add 7, and print it out.
Two strings are equal
Read in two strings (one per line) and print "exact match" if they are exactly the same (else print "not the same").
Strings are similar
Read in 2 strings (one per line). Output "exact match" if they are exactly the same, "similar" if they are the same except for case differences, else "not the same".
Hint: the lowercase function might be helpful!
Print FizzBuzz from 1 to 20. Read the Fizz value and the Buzz value from the input.
Print the Fibonacci sequence. The number of items to print is determined by an integer read in on the input. If the input is 0 then print nothing.
Draw a square
Read in a number (integer) and print out a square of that size.
Read in a number (integer) and print out a square using the symbols plus (+), minus (-) and bar (|).
First, you take the position of the letter in the alphabet, P (P is 1-indexed here). Then, you print each letter until the input (inclusive) on a line, preceded by P-1 and repeat that letter P times, interleaving with spaces.
Read in a number and check if it is a palindrome or not.