Extra Programs
Extra Programs
Output Format:
For each test case, print an integer that denotes the sum of all the multiples of 3
or 5 below N.
Sample Input 0
2
10
100
Sample Output 0
23
2318
2. Each new term in the Fibonacci sequence is generated by adding the previous
two terms. By starting with 1 and 2 , the first 10 terms will be:
1,2,3,5,8,13,21,34,55,89 ………..
By considering the terms in the Fibonacci sequence whose values do not exceed N,
find the sum of the even-valued terms.
Input Format
First line contains T that denotes the number of test cases. This is followed by T lines,
each containing an integer, N.
Output Format
3. A palindromic number reads the same both ways. The smallest 6 digit palindrome
made from the product of two 3-digit numbers is. 101101=143x707.
Find the largest palindrome made from the product of two 3-digit numbers which is less
than N.
Input Format
First line contains T that denotes the number of test cases. This is followed by T lines,
each containing an integer, N.
Output Format
Print the required answer for each test case in a new line.
Sample Input 0
2
101110
800000
Sample Output 0
101101
793397
4. 2520 is the smallest number that can be divided by each of the numbers from 1 to 10
without any remainder.
What is the smallest positive number that is evenly divisible (divisible with no
remainder) by all of the numbers from 1 to N?
Input Format
First line contains T that denotes the number of test cases. This is followed by T lines,
each containing an integer, N.
Output Format
6. You need to take an integer input and then draw the pattern according to it. Say
for example if you enter 5 then, the pattern should be like this-
1
333
55555
7777777
999999999
Input Format
You will take an integer input n from stdin.
Constraints
1 <= n <= 1000
Output Format
Your output should be the pattern according to the input which you had entered.
7. You need to take an integer input and then draw the pattern according to it. Say
for example if you enter 5 then, the pattern should be like this-
1
222
33333
4444444
555555555
Input Format
You will take an integer input n from stdin.
Constraints
1 <= n <= 1000
Output Format
Your output should be the pattern according to the input which you had entered.
8. You need to take an integer input and then draw the pattern according to it. Say
for example if you enter 4 then, the pattern should be like this-
A
CCC
EEEEE
GGGGGGG
Input Format
You will take an integer input n from stdin.
Constraints
1 <= n <= 13
Output Format
Your output should be the pattern according to the input which you had entered.
9. You need to take an integer input and then draw the pattern according to it. Say
for example if you enter 5 then, the pattern should be like this-
A
ABC
ABCDE
ABCDEFG
ABCDEFGHI
Input Format
You will take an integer input n from stdin.
Constraints
1 <= n <= 26
Output Format
Your output should be the pattern according to the input which you had entered.
10. You need to take an integer input and then draw the pattern according to it. Say
for example if you enter 5 then, the pattern should be like this-
0
101
21012
3210123
432101234
Input Format:
You will take an integer input n from stdin.
Constraints:
0 <= n <= 1000
Output Format:
Your output should be the pattern according to the input which you had entered.
Input
5
Output
0
101
21012
3210123
432101234