Você está na página 1de 8

Applicable for the academic year 2018-19 Batch: 2020

ADVANCED TECHNICAL TRAINING LABORATORY


Lab Hours/ Week :2 Credits : 1
Sub. Code : 6CESL1 CIE Marks : 50
SEE Marks : 50
Note:
50% of total marks for PART-A question.
50% of total marks for PART-B.
The student has to pick one question in PART - A from lots and has to pick one
question in PART - B from lots.

PART – A
1. Yaswanth’s number is a number whose sum of the factorial of digits is equal to the number
itself. Given a number N as input. Write a program to check whether this number is Yaswanth’s
number or not.
First line of input contains a single integer T which denotes the number of
Input test cases. Then T test cases follow. First line of each test case contains a
single integer N.
For each test case print "YES" without quotes if N is a Yaswanth’s Number
Output
otherwise print "NO
1 <= T <= 100
Constraint
1 <= N <= 105
Input Output
Example a. 2
YES
b. 145
NO
c. 235
Exercises
Test Cases
Input Output
Problem 1 a. 2
YES
b. 145
NO
c. 235
a. Four Nine Eight
Seven
a. 7894
b. Two Nine Five
Problem 2 b. 1592
One
c. 1369
c. Nine Six Three
One
2. Yaswanth and Sweety are off to the wedding of a close relative. This time they have to
travel without their guardians. Yaswanth got very interested in the arrangement of seats
inside the train coach. The entire coach could be viewed as an arrangement of consecutive
blocks of size 8.

Berth Number Compartment


1- 8 1

Department of EC,EE, EI & TE, SIT, Tumkur 1


Applicable for the academic year 2018-19 Batch: 2020

9 - 16 2
17 - 24 3
... and so on
Each of these size-8 blocks are further arranged as:
1LB, 2MB, 3UB, 4LB, 5MB, 6UB, 7SL, 8SU
9LB, 10MB, ...
...
Here LB denotes lower berth, MB middle berth and UB upper berth.
The following berths are called Train-Partners:

3UB | 6UB
2MB | 5MB
1LB | 4LB
7SL | 8SU
And the pattern is repeated for every set of 8 berths. Yaswanth and Sweety are playing this
game of finding the train partner of each berth. Can you write a program to do the same?

Input Output
Example a. 1 a. 4LB
b. 5 b. 2MB
c. 3 c. 6UB
Exercises
Test Cases
Input Output
Problem 1 a. 10,25,9 a. 25, 9
b. 11,98,105 b. 105, 11
Description Print the Higher and lower number from given three numbers.
Input Output
Problem 2 a. 145 a. 20
b. 120 b. 0
c. 1889 c. 576
Print the multiplication of digits in a given number. For example, test
Description
case1, 145 if you multiply 1*4*5 you will get the output as 20.

3. The program must accept an integer array of size N containing only 0's and 1's as the input.
The program must bring all the zeros to the front and all the ones to the end of the array.
Then the program must print the modified array as the output.
Boundary 1 <= N <= 1000
Condition(s): 0 <= Array Element Value <= 1
Input Output
Example a. 0 1 1 0 1 0 0 a. 0 0 0 0 1 1 1
b. 1 1 1 0 b. 0 1 1 1
There are 4 zeros and 3 ones in the input. So print all the zeros at the
Explanation
beginning and all the ones at the end. Hence the output is 0 0 0 0 1 1 1

Department of EC,EE, EI & TE, SIT, Tumkur 2


Applicable for the academic year 2018-19 Batch: 2020

Exercises
Input Output
Problem 1 a. {1,2,4,6,5} a. 1 4 12 20 5 21
b. {2,4,5,6,7} b. 2 10 24 35 7
You need to print the first and last index numbers as it is because first
number does not previous number and last number does not next
Description
number so print them as it and middle numbers have previous and
next number then multiply and print the output.
Input Output
Problem 2 a. {19,1,24,79,88} a. 1 1 0 1 0
b. {11,22,44,33,66} b. 1 0 1 0 1
You need to print 1 in place of Odd item and print 0 in the place of
Description
Even item from the given list.

4. The program must accept an integer N as the input. The program must print the square root
of each digit in N with the precision up to 2 decimal places as the output.
Boundary
1 <= N <= 10^7
Condition(s):
Input Output
Example a. 23578 a. 1.41 1.73 2.24 2.65 2.83
b. 149 b. 1.00 2.00 3.00
 The square root of the digit 2 is 1.41
 The square root of the digit 3 is 1.73
 The square root of the digit 5 is 2.24
Explanation
 The square root of the digit 7 is 2.65
 The square root of the digit 8 is 2.83
 Hence the output is 1.41 1.73 2.24 2.65 2.83
Exercises
Input Output
Problem 1 a. {10 20 12 18 90} a. Yes
b. {10 20 12 18 19} b. No
You need to print Yes or No according to the given test case. For
example, test case 1, 20 12 18 - all three are greater than 10 and lesser
Description than 90. Hence YES is printed. For second test case, 20 is not lesser
than 19. Hence NO is printed.

5. Your program need to accept the series of integer numbers as an array and it has to print the output
in the following order.
Input Output
Example 1
{1,2,3,4,2,2,3}, Target Number 2 !! !!!!! !!!!!!

Department of EC,EE, EI & TE, SIT, Tumkur 3


Applicable for the academic year 2018-19 Batch: 2020

Your program needs to search for the key in the given array and when it is
Explanation found the in the list it needs to print the position. According to the position we
need to print the output with ! Sign.

6. Your program need to accept a string (alphanumeric) includes white spaces also.
Input Output
Example 1 application Testing TESTING
sit Test app TEST
H e be o n E
Your program needs to print the second word in upper case format from
the given input. For the test case 1, find first white space and print the
next to it and stop it when the next white space occurs. By using ASCII
Explanation
values, if the range is between 65 to 90 then print the character same, if
the character ASCII between the range of 97 to 122 then convert that
into upper case and print the character.
Exercises
Input Output
Problem 1 Appl18ication89 1889
Woring147 147
Given string is alphanumeric; You need to extract the digits from the
Description given string. For test case 1, Appl18ication89 having the digits as 1889
so you need to print that as output.
Input Output
Problem 2 application 5
testing 2
Given string is lower case string, You need to find the vowels count
Description from the given string. For the test case 1 there are 5 vowels (a,e,i,o,u)
are present so the output is 5.

7. The program must accept an integer N as the input. The program must print the Fibonacci
series in the reverse order as the output.
Boundary
5 <= N <= 85
Condition(s):
Input Output
Example 5 32210
12 89 55 34 21 13 8 5 3 2 1 1 0

8. The program must accept an integer N as the input. The program must print count of prime
number.
1 <= N <= 10^5

Department of EC,EE, EI & TE, SIT, Tumkur 4


Applicable for the academic year 2018-19 Batch: 2020

Test Cases
Input Output
Problem 1 10,30 6- [11,13,17,19,23,29]
10,100 21- [11,13,17,19,23,29 ….]
You need to print the count of prime number count between two limits
Description
and Prime numbers.

PART – B

1. Write a C program to implement STACK to perform the PUSH, POP and DISPLAY
operations. [Implement the 10 size]
2. Write a C program to implement ordinary QUEUE to perform the insertion, deletion and
display operations. [Operations with Array size of 12].
3. Your Program need to accept the alphanumeric string and you have print the output in the
following manner Hebeon Tech -- V: 4 C: 6 W: 1
Input Output
ae
Example 1 mango tes mt ns
g*
o*
uo
nr
*k
Example 2 run working rw
*i
*n
*g
Example 3 Application Target: 4 Applicanoit
You need reverse the k characters in the reverse order from the right
side of the given array. For the given test last four characters are
Explanation
tion when they reversed noit. So you need print those characters in
reverse order and first characters will be same.

4. Mr Jack has created a rectangle box with some rows(r) and columns(c). He has placed
different numbers on the rectangle box in each cell. Now Jack wants to find out all the
numbers that are not placed in the edges and further Jack wants to add those numbers to

Department of EC,EE, EI & TE, SIT, Tumkur 5


Applicable for the academic year 2018-19 Batch: 2020

get a single result as output i.e. Jack wants the numbers that have a number above, a
number below to it, the number on the left and a number on the right.
Input Output
18 5 5 21
Example 1
23 24 1 25
45
8 5 15 17
23 4 29 2
The elements which are not present along the border are 24 1 5 15.
Explanation
Hence the output is 24+1+5+15 = 45.
Input Output
5 6
93 60 84 26 22 95
Example 2 99 96 86 90 34 0
695
0 83 63 10 74 75
36 35 98 4 22 18
20 8 27 94 64 30
Exercises
Input Output
Problem 1 123
456 15
789
You need to identify the diagonal elements from the given multi-
Description dimensional array and print the sum of them. For the given test you
need add the diagonal elements 1 + 5 + 9 -- 15.
Input Output

Problem 2 1 2 3
41 5 6 3 41 87
7 87 9
You need to identify the large number from each row in the given input.
For the given test case in the first row the large number is 3, second
Description
row large number is 41 and third row the large number is 87 so that
output will be 3 41 87.
5. Write a C++ program to compute the area of circle, rectangle and triangle (given with 3
sides) by overloading the area ( ) function.
Write a C++ program to add i) two integer numbers ii) two float numbers iii) One integer
and one float numbers by using function overloading concept.

Department of EC,EE, EI & TE, SIT, Tumkur 6


Applicable for the academic year 2018-19 Batch: 2020

6. The program must accept a string S as the input. The program must toggle the case of
vowels in the string S. Then the program must print the modified string as the output.
Boundary conditions 1 <= Length of S <= 100
Input Output
Example 1
EquilIbriUm eqUIlibrIum
The vowels in the string "EquilIbriUm" are 'E', 'u', 'i', 'I', 'i' and 'U'. So
Explanation toggle the case of all the vowels in the string "EquilIbriUm".
Hence the output is eqUIlibrIum
Input Output
Example 2
JUNKVIRUS JuNKViRuS
Exercises
Input Output
Problem 1 orange puboif
working apuojoi
You need to print the next vowel in the alphabet list if the current
Description character is consonant and you need to print the consonant for the
vowel in the alphabet list.

7. Write a C program to print the following pattern


1 A
23 BC
456 DEF
7 8 9 10 GHIJ
11 12 13 14 15 KLMNO

8. The program must accept an integer N as the input. The program must print the square root
of each digit in N with the precision up to 2 decimal places as the output.
Input Output
Problem a. 14689025 a. 1695
b. 1357935 b. 1
 For input a,
The adjacent digit of 1 is 4 (even number). So 1 is printed.
Description The adjacent digits of 4 are 1 and 6 (only 6 is even). So 4 is not
printed.
The adjacent digits of 6 are 4 and 8 (both are even numbers). So 6 is

Department of EC,EE, EI & TE, SIT, Tumkur 7


Applicable for the academic year 2018-19 Batch: 2020

printed.
The adjacent digits of 8 are 6 and 9 (only 6 is even). So 8 is not
printed.
The adjacent digits of 9 are 8 and 0 (both are even numbers). So 9 is
printed.
The adjacent digits of 0 are 9 and 2 (only 2 is even). So 0 is not
printed.
The adjacent digits of 2 are 0 and 5 (only 0 is even). So 2 is not
printed.
The adjacent digit of 5 is 2 (even number). So 5 is printed.
Hence the output is 1695.
 For test input b, then you need to print -1.

Department of EC,EE, EI & TE, SIT, Tumkur 8

Você também pode gostar