First and last digits
Given two numbers M and N, write a program to count of the numbers which have the same first and last digits in the given range M to N(inclusive M and N)
Input
the first line of input will contain a positive integer M.
the second line of input will contain a positive integer N.
output
The output should be an integer denoting the count of the numbers in the range which meet the given condition.
Explanation
For example, if the given number are M is 5and N is 30, the numbers which have the first and last digit equal in the given range(5,6,....29,30) are 5 6 7 8 9 11 and 22. so the output should be 7.
sample input 1
5
30
sample output 1
7
sample input 2
1
10
sample output 2
9
Elements of anti diagonal
Write a program to print the anti-diagonal elements in the given matrix.
input
The first line of input will contain an integer N, denoting the number of rows and columns of the input matrix.
the second line of input will contain N space-separated integers denoting the elements of each row of the matrix.
output
The output should be a list containing the anti-diagonal elements.
explanation
For example, if the given N is 3, and the given matrix is
1 2 3
4 5 6
7 8 9
The anti-diagonal elements of the above matrix are 3 5 7. so the output should be the list
[3, 5, 7]
sample input 1
3
1 2 3
4 5 6
7 8 9
sample output 1
[3, 5, 7]
sample input 2
5
44 71 46 2 15
97 21 41 69 18
78 62 77 46 63
16 92 86 21 52
71 90 86 17 96
sample output 2
[15, 69, 77, 92, 71]
Interleave String
Given two strings, write a program to merge the given two strings by adding characters in alternating order, starting with the first string. If a string is longer than the other, append the additional characters onto the end of the merged string.
input
the first line of input will containing a string.
the second line of input will containing a string.
the strings may contain special characters ,digits and string.
output
the output should be the merged string
explanation
For example, if the given strings are "abc" and "pqrs", then alternating characters from each string are merged as "a" from "abc", "p" from "pqr" "b" from "abc" and so on ...., resulting in the merged string "apbqcr".
sample input 1
abc
pqr
sample output 1
apbqcr
sample input 2
abc
pqrst
sample output 2
apbqcrst
Write a program to find length of string by using pointers
Make a function which take a array which store 10 students cgpa. Find the the highest cgpa of student in the array.
Make a function which take an integer array and return sum of all even values.
(Note: Make array of 10 size in the main function)
Yes your output is right thank you, but I am sorry I am not expecting this output,
Input: 1
3
Your output: 1
2
3
My expecting output : 1 2 3
Please review
using inheritance write a Program to calculate discount If customer purchase clothes on Offseason, set discount 15% and on Onseason 40%
Should use two classes, Onseason and Offseason
Use two methods- discount(method name should be same)
python program that needs to ask the user for her or his email address in the formatfirstname.lastname@bahria.edu.pk OR firstname.lastname@gmail.com. The application takes asinput this email address, parses the email and replies to the user with first name, last name and hostname
Write a program in C to show the basic declaration of pointer.
Pointer : Show the basic declaration of pointer :
-------------------------------------------------------
Here is m=10, n and o are two integer variable and *z is an integer
z stores the address of m = 0x7ffd40630d44
*z stores the value of m = 10
&m is the address of m = 0x7ffd40630d44
&n stores the address of n = 0x7ffd40630d48
&o stores the address of o = 0x7ffd40630d4c
&z stores the address of z = 0x7ffd40630d50