Last Updated on September 15, 2022 by Gokul Kannan
In this article, we’ll discuss how to crack Accenture coding test. Most of Accenture Coding questions will be of the same pattern which are discussed in this article.
If you want to crack the exam in the first attempt then you’ve practiced more and more coding questions which were asked in the previous years.
You can solve these questions using any of the programming languages from C, C++, Java, and Python. So you don’t need to master all the programming languages, just master any of the one programming language.
You can now get one step closer to your dream job and streamline your placement preparation journey with PrepBytes Placement Programs
Marking Scheme of Accenture Coding Section
The candidates who clear all the first two rounds will have to go through the third round which is the coding round. All the candidates will have to solve 2 questions in 45 minutes. So to pass the third round and get your dream job at least you’ve to achieve one partial output. But the second question should be completely solved.
So to get passed in this section the candidate should get one partial output and one complete output.
Resources To Prepare For Accenture Coding Test
Before we jump into the previously asked Accenture coding questions. Prepbytes has launched the best PrepBytes, TCS, IBM, Infosys, and other similar exams and companies.
Question 1 Problem Statement – Vohra went to a movie with his friends in a Wave theater and during break time he bought pizzas, puffs and cool drinks. Consider the following prices :
 Rs.100/pizza
 Rs.20/puffs
 Rs.10/cooldrink
Generate a bill for What Vohra has bought.
Sample Input 1:
 Enter the no of pizzas bought:10
 Enter the no of puffs bought:12
 Enter the no of cool drinks bought:5
Sample Output 1:
Bill Details  No of pizzas:10
 No of puffs:12
 No of cooldrinks:5
 Total price=1290
#include#include int main () { int totalprice; printf ("Enter the no of pizzas bought:\n"); int pizza; scanf ("%d", &pizza); printf ("Enter the no of puffs bought:\n"); int puffs; scanf ("%d", &puffs); printf ("Enter the no of cool drinks bought:\n"); int coolDrinks; scanf ("%d", &coolDrinks); int pizzaa = pizza * 100; int puffss = (puffs) * 20; int coolDrinkss = (coolDrinks) * 10; printf ("Bill Details\n"); printf ("No of pizzas: %d\n", pizza); printf ("No of puffs: %d\n", puffs); printf ("No of cooldrinks: %d\n", coolDrinks); totalprice = pizzaa + puffss + coolDrinkss; printf ("Total price= %d\n", totalprice); printf ("ENJOY THE SHOW!!!"); return 0; }
Question 2:Problem Statement – Ritik wants a magic board, which displays a character for a corresponding number for his science project. Help him to develop such an application.
For example when the digits 65,66,67,68 are entered, the alphabet ABCD is to be displayed.
[Assume the number of inputs should be always 4 ]
Sample Input 1:
 Enter the digits:
65
66
67
68
Sample Output 1:
65A
66B
67C
68D
Sample Input 2:
 Enter the digits:
115
116
101
112
Sample Output 2:
115s
116t
101e
112p
import java.util.Scanner; public class Main { public static void main (String args[]) { Scanner in = new Scanner (System.in); System.out.println ("Enter the digits: "); int a = in.nextInt (); int b = in.nextInt (); int c = in.nextInt (); int d = in.nextInt (); char q = (char) a; char w = (char) b; char e = (char) c; char r = (char) d; System.out.println (); System.out.print (a); System.out.println ("" + q); System.out.print (b); System.out.println ("" + w); System.out.print (c); System.out.println ("" + e); System.out.print (d); System.out.println ("" + r); } }
Question 3: Problem Statement – Rhea Pandey’s teacher has asked her to prepare well for the lesson on seasons. When her teacher tells a month, she needs to say the season corresponding to that month. Write a program to solve the above task.
 Spring – March to May,
 Summer – June to August,
 Autumn – September to November and,
 Winter – December to February.
Months should be in the range 1 to 12. If not, the output should be “Invalid month”.
Sample Input 1:
 Enter the month:11
Sample Output 1:
 Season:Autumn
Sample Input 2:
 Enter the month:13
Sample Output 2:
 Invalid month
import java.util.Scanner; public class Main { public static void main(String args[]) { System.out.print("Enter the month:"); Scanner s = new Scanner(System.in); int entry = s.nextInt(); switch (entry) { case 12: case 1: case 2: System.out.println("Season:Winter"); break; case 3: case 4: case 5: System.out.println("Season:Spring"); break; case 6: case 7: case 8: System.out.println("Season:Summer"); break; case 9: case 10: case 11: System.out.println("Season:Autumn"); break; default: System.out.println("Invalid month"); } } }
Question 4: To speed up his composition of generating unpredictable rhythms, Blue Bandit wants the list of prime numbers available in a range of numbers.Can you help him out?
Write a program program to print all prime numbers in the interval [a,b] (a and b, both inclusive).
Note
 Input 1 should be less than Input 2. Both the inputs should be positive.
 Range must always be greater than zero.
 If any of the condition mentioned above fails, then display “Provide valid input”
 Use a minimum of one for loop and one while loop
Sample Input 1:
2
15
Sample Output 1:
2 3 5 7 11 13
Sample Input 2:
8
5
Sample Output 2:
Provide valid input
#include#include int main() { int a,b; scanf("%d%d",&a,&b); int flag; if(a<=0  b<=0  a>=b) printf("Provide valid input"); else { while(a<=b) { if(a==2) printf("%d ",a); else if(a==1) { a++; continue; } else { flag=0; for(int i=2;i<=a/2;i++) { if(a%i==0) { flag=1; break ; } } if(flag==0) printf("%d ",a); } a++; } } return 0; }
Question 5: Problem Statement:
Problem Statement – Chaman planned to choose a four digit lucky number for his car. His lucky numbers are 3,5 and 7. Help him find the number, whose sum is divisible by 3 or 5 or 7. Provide a valid car number, Fails to provide a valid input then display that number is not a valid car number.
Note : The input other than 4 digit positive number[includes negative and 0] is considered as invalid.
Refer the samples, to read and display the data.
Sample Input 1:
 Enter the car no:1234
Sample Output 1:
 Lucky Number
Sample Input 2:
 Enter the car no:1214
Sample Output 2:
 Sorry it’s not my lucky number
Sample Input 3:
 Enter the car no:14
Sample Output 3:
 14 is not a valid car number
#includeusing namespace std; int main () { int n; cin >> n; int digit = floor (log10 (n) + 1); if (n <= 0 or ! (digit == 4)) cout << n << " is not a valid car number"; else { int sum = 0; while (n > 0) { sum += n % 10; n /= 10; } if (sum % 3 == 0 or sum % 5 == 0 or sum % 7 == 0) cout << "Lucky Number"; else cout << "Sorry its not my lucky number"; } return 0; }
How To Crack Accenture Coding Test FAQs

In which programming language we should solve all the Accenture coding questions?
The students can use any of the programming languages from C, C++, Java, and Python to solve coding questions. 
Which Platform does Accenture use to conduct the exam?
Accenture uses the Cocubes platform to conduct all its exams and assessments. 
What is the difficulty level of Coding questions asked in the exam?
The first question is of medium difficulty level and the second question is very difficult. 
Is it compulsory to clear the Accenture Coding Round?
Yes, it’s compulsory to clear the Accenture Coding Round.
This article tried to discuss how to crack Accenture Coding Test Hope this blog helps you understand and solve the problem. To Practice more problems you can check out Mock Tests at Prepbytes.