Create a function Maximum using templates, your function should have the following prototype
t Maximum (t x, t y)
This function should return the maximum values out of the two values being passed, in your main function create variables of different types, integer, character and double and check what your function returns for each different variable type.
Square to the Next Level
by CodeChum Admin
We've already tried printing out the values of an array in reversed order, right? Today, we shall compute for the squares of all the numbers.
There's already a predefined array/list containing 100 integer values. Loop through each values, compute their squares, and display them.
Output
Multiple lines containing an integer.
4
9
25
10000
49
9
25
9
1
16
.
.
.
by CodeChum Admin
I have a list of 3 numbers here with me that's already in the code editor, but I want you to add some more to this list by inputting some more numbers yourself in one line and then, print out only the even numbers from the list.
Can you do that for me?
Input
A line containing integers separated by a space.
33·54·32·11·8Output
Multiple lines containing an integer.
2
54
32
8by CodeChum Admin
I want you to make a array/list of numbers for me. All you have to do is make a program that will let me input any random integer in one line. Afterwards, it will then print out all the numbers I've inputted, on separate lines.
Care to do that for me?
Input
A line containing integers separated by a space.
1·64·32·2·11Output
Multiple lines containing an integer.
1
64
32
2
11Write a statement that assigns numCoins with numNickels + numDimes. Ex: 5 nickels and 6 dimes results in 11 coins.
Note: These activities may test code with different test values. This activity will perform two tests: the first with nickels = 5 and dimes = 6, the second with nickels = 9 and dimes = 0.
Write a user-define function, called checkNumber(x), that takes as an input an integer
number (read in the main function using input) and prints out positive, negative, or
zero according to whether the number is positive, negative, or zero.
Programming languages like Python are formal languages with strict syntax rules. But those rules can change over time with newer versions of the programming language. Your textbook covers Python 3, but you may only have access to Python 2.
Download and install a working Python environment, preferably Python 3, or get an account with PythonAnywhere. Refer to the Software Requirements/Installation section of the course syllabus for details.
Type the statements below into your Python interpreter. For each statement, copy the output into your Discussion Assignment and explain the output. Compare it with any similar examples in the textbook, and describe what it means about your version of Python.
>>> print 'Hello, World!'
>>> 1/2
>>> type(1/2)
>>> print(01)
>>> 1/(2/3)
you are given a positive integer n. your task is to find the number of positive integers k<=n such that k is not divisible by any of the following numbers 2,3,4,5,6,7,8,9,10.
A pythagorean triplet is a set of three integers a, b and c such that a**2+b**2=c**2.in the given limit L, find the number of pythagorean triplets R that can be formed (such that a<b<c).
the principal wants to send an electrical message inviting all the parents to a parents evening. what type of software would the principal use?