Written by students who passed Immediately available after payment Read online or as PDF Wrong document? Swap it for free 4.6 TrustPilot
logo-home
Exam (elaborations)

Exam (elaborations) Accenture Technical

Rating
-
Sold
-
Pages
5
Grade
A+
Uploaded on
05-10-2023
Written in
2023/2024

This document contains all the questions to be asked in Accenture placement drive. Take a look at it to get a gist of the questions and clear the coding test successfully

Institution
Course

Content preview

ACCENTURE TECHNICAL CODING

1. A carry is a digit that is transferred to left if sum of digits exceeds 9 while adding two numbers from
right-to-left one digit at a time
You are required to implement the following function, Int NumberOfCarries(int num1 , int num2);
The functions accepts two numbers ‘num1’ and ‘num2’ as its arguments. You are required to calculate
and return the total number of carries generated while adding digits of two numbers ‘num1’ and ‘
num2’.
Assumption: num1, num2>=0
Example:
Input
• Num 1: 451
• Num 2: 349
Output
•2
Explanation:
Adding ‘num 1’ and ‘num 2’ right-to-left results in 2 carries since ( 1+9) is 10. 1 is carried and
(5+4=1) is 10, again 1 is carried. Hence 2 is returned.
Sample Input
Num 1: 23
Num 2: 563
Sample Output
0

2. N-base notation is a system for writing numbers which uses only n different symbols, This symbols
are the first n symbols from the given notation list(Including the symbol for o) Decimal to n base
notation are (0:0, 1:1, 2:2, 3:3, 4:4, 5:5, 6:6, 7:7, 8:8, 9:9, 10:A,11:B and so on upto 35:Z)
Implement the following function, Char* DectoNBase(int n, int num):
The function accept positive integer n and num Implement the function to calculate the n-base
equivalent of num and return the same as a string
Steps:
• Divide the decimal number by n,Treat the division as the integer division
• Write the the remainder (in n-base notation)
• Divide the quotient again by n, Treat the division as integer division
• Repeat step 2 and 3 until the quotient is 0
• The n-base value is the sequence of the remainders from last to first
Assumption:
1 < n < = 36
Example
Input
n: 12



Page 1 of 5

, ACCENTURE TECHNICAL CODING

num: 718
Output
4BA
Explanation
num Divisor quotient remainder
718 12 59 10(A)
59 12 4 11(B)
4 12 0 4(4)
Sample Input
n: 21
num: 5678
Sample Output
CI8
3. The function def differenceofSum(n. m) accepts two integers n, m as arguments Find the sum of all
numbers in range from 1 to m(both inclusive) that are not divisible by n. Return difference between
sum of integers not divisible by n with sum of numbers divisible by n.
Assumption:
● n>0 and m>0
● Sum lies between integral range
Example
Input
n:4
m:20
Output
90
Explanation
● Sum of numbers divisible by 4 are 4 + 8 + 12 + 16 + 20 = 60
● Sum of numbers not divisible by 4 are 1 +2 + 3 + 5 + 6 + 7 + 9 + 10 + 11 + 13 + 14 + 15 + 17 + 18
+ 19 = 150
● Difference 150 – 60 = 90
Sample Input
n:3
m:10
Sample Output
19
4. You are required to implement the following Function def LargeSmallSum(arr).
The function accepts an integers arr of size ’length’ as its arguments you are required to return the
sum of second largest largest element from the even positions and second smallest from the odd
position of given ‘arr’.


Page 2 of 5

Written for

Institution
Course

Document information

Uploaded on
October 5, 2023
Number of pages
5
Written in
2023/2024
Type
Exam (elaborations)
Contains
Only questions

Subjects

$8.49
Get access to the full document:

Wrong document? Swap it for free Within 14 days of purchase and before downloading, you can choose a different document. You can simply spend the amount again.
Written by students who passed
Immediately available after payment
Read online or as PDF

Get to know the seller
Seller avatar
namithajayaraj

Get to know the seller

Seller avatar
namithajayaraj Bharath Institute of Higher Education and Research
Follow You need to be logged in order to follow users or courses
Sold
-
Member since
2 year
Number of followers
0
Documents
7
Last sold
-

0.0

0 reviews

5
0
4
0
3
0
2
0
1
0

Recently viewed by you

Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their tests and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Working on your references?

Create accurate citations in APA, MLA and Harvard with our free citation generator.

Working on your references?

Frequently asked questions