Initialize a string of size 40. Write a program that prints all unique alphabets from string. After printing
them sort them in ascending order.
For example: Hi world I am here to help you.
Unique characters are: H, I, W, O, R, L, D, A, M, E, T, P, Y, U.
Sorted: A, D, E, H, I, L, M, O, P, R, T, U, W, Y
in c++
Fill in the blank in the following program that draws a figure resembling the letter 'Z' with sides (50, 100, 50) and the angle between them to be 60 degrees.
Remember that the turtle starts at the center of the canvas and facing right.
left(180); forward(50); right(B1); forward(B2); left(B3); forward(50);
What is B1?
Write a C++ program in which, read a c-string from user. Now your task is to replace all possible pairs of character from input string.
For example:
Input:
Array: good
Output:
Array: gd
What is the value of f(846) for the function below?
def f(x):
d=0
y=1
while y <= x:
d=d+1
y=y*3
return(d)Write a program to get the purchasing and selling price of a product and calculate its profit when 5 products are sold.
Write a C++ program in which, read a c-string from user. Now your task is to replace all possible pairs of character from input string
Consider the following function mys:
def mys(m):
if m == 1:
return(1)
else:
return(m*mys(m-1))
Which of the following is correct?
The function always terminates with mys(n) = factorial of n
The function always terminates with mys(n) = 1+2+...+n
The function terminates for non-negative n with mys(n) = factorial of n
The function terminates for positive n with mys(n) = factorial of n
For what value of n would g(57,n) return 7?
def g(m,n):
res = 0
while m >= n:
res = res+1
m = m-n
return(res)
What is h(41)-h(40), given the definition of h below?
def h(n):
s = 0
for i in range(1,n+1):
if n%i > 0:
s = s+1
return(s)Initialize a string of size 40. Write a program that prints all unique alphabets from string. After printing them sort them in ascending order.
For example: Hi world I am here to help you.
Unique characters are: H, I, W, O, R, L, D, A, M, E, T, P, Y, U.
Sorted: A, D, E, H, I , L,M, O, P, R, T, U, W, Y