# Accenture Pseudo Code Question and Answer 2023

## Accenture Pseudo Code Questions 2023 for Freshers

Accenture Pseudo Code Test Questions with Answers 2023 are discussed below.

It is a test that assesses the ability of candidates to write algorithms and solve problems using pseudo code, which is a high-level description of a computer program or algorithm that uses natural language constructs to describe the steps involved in solving a problem. ## Accenture Pseudo Code Questions 2024 for Freshers

Accenture Pseudo Code Test Questions with Answers 2024 are discussed below. It is a test that assesses the ability of candidates to write algorithms and solve problems using pseudo code, which is a high-level description of a computer program or algorithm that uses natural language constructs to describe the steps involved in solving a problem, ## About Pseudo Code Test 2023

Pseudo code test is a type of test conducted by Accenture to evaluate the problem-solving skills of candidates. The difficulty level of the paper is high. The questions may be in the form of a problem statement or a code snippet, and the candidates are required to understand pseudo code to solve the problem and to find the output.

For more detailed information you can visit to the Accenture Dashboard.

## Accenture Pseudo Code Question and Answer 2023

Accenture Information
Total Time Duration 40 minutes (Shared)
Number of Question 18 Ques
Negative Marking No

### Detailed Accenture Pseudo Code Paper Pattern

Topics No. of questions Difficulty
C 2 Medium
C++ 3 Medium
OOPS 3 Medium
Data structure 2 Medium

Use Coupon Code “CT10” and get flat 10% off on PrepInsta Prime, and get additional one month extension on 12 months and above plan!!

### Related Banners

Get PrepInsta Prime & get Access to all 200+ courses offered by PrepInsta in One Subscription

## Practice from Accenture Sample Pseudo Code Questions

1. What will be the output of the following pseudo code?

```For input a = 5 & b = 5.
function (input a, input b)
If (a < b)
return function (b, a)
elseif (b != 0)
return (a * function (a, b - 1))
else
return 0``` 15625

15625

17.19%

625

625

28.35%

3125

3125

41.61%

525

525

12.86%

function(5,5) will return 5 x function(5,4)

function(5,4) will return 5 x 5 x function(5,3)

function(5,3) will return 5 x 5 x 5 x function(5,2)

function(5,2) will return 5 x 5 x 5 x 5 function(5,1)

function(5,0) will return 5 x 5 x 5 x 5 x 5 = 3125 2. What will be the output of the following pseudo code

```initialize char c
set c= a
print "%d",a``` 64

64

16.96%

97

97

35.05%

a

a

15.39%

error

error

32.6%

The code will print the ASCII value of the entered character 3. What will be the output of the following code ?

```#include<stdio.h>
int main ()
{
char c,a,b;
c='f';
a='s';
b='x';
int sum= c+a+b;
printf ("%d", sum);
}``` 324

324

13.82%

315

315

14.16%

320

320

10.82%

337

337

61.19%

The following code will add the ASCII values of the given characters
f = 102
s = 115
x = 120
sum = 102+115+120 = 337 4. What will be the output of the following pseudo code for arr[]= 1,2,3,4,5

```initialize i,n
intialize an array of size n
accept the values for the array
for i= 0 to n
arr[i] = arr[i]+arr[i+1]
end for
print the array elements``` 3 5 7 9 5

3 5 7 9 5

39.19%

3 5 7 9 11

3 5 7 9 11

24.95%

3 5 9 15 20

3 5 9 15 20

6.9%

error

error

28.96%

The following pseudo code will add the first element with the second, the second element with the third, the third element with the fourth and the fourth element with the fifth, the fifth element will remain as it is
and hence the output will be 3 5 7 9 5 5. What will be the output of the following pseudo code ?

```#include<stdio.h>
int fun(int x, int y);
int main()
{
int i,n;
i=5;
n=7;
int f = fun(5,7);
printf("%d", f);
}

int fun(int x, int y)
{
if(x<=0)
return y;
else
return(fun(x-1,y-1));
}``` 0(zero)

0(zero)

19.52%

1

1

12.71%

2

2

59.42%

3

3

8.35%

This is a recursive code the function fun(int x, int y) will keep on calling itself until the value of x becomes zero, and when the base condition executes it will print the value of y
Since the value of x is 5 and it is getting decremented by 1 on every function call and the value of y is also getting decremented by 1 on every function call. On the execution of base condition the value of x will become 0(as it has been decremented by 1, 5 times) and the value of y will become 2(as it is also has been decremented by 1, 5 times) and hence the output will be 2 6. What will be the output of the following code

```#include <stdio.h>
#include <stdlib.h>
#define LIMIT 10 /*size of integers array*/
int main(){
unsigned long long int i,j;
int *primes;
int z = 1;
primes = malloc(sizeof(int)*LIMIT);
for (i=2;i<LIMIT;i++)
primes[i]=1;
for (i=2;i<LIMIT;i++)
if (primes[i])
for (j=i;i*j<LIMIT;j++)
primes[i*j]=0;
for (i=2;i<LIMIT;i++)
if (primes[i])
printf("%dth prime = %dn\n",z++,i);
return 0;

}``` None of the below

None of the below

9.72%

1th prime - 2n
2th prime - 3n
3th prime - 5n

1th prime - 2n
2th prime - 3n
3th prime - 5n

21.76%

1th prime - 2n
2th prime - 3n
3th prime - 5n
4th prime - 7n
5th prime - 9n
6th prime - 11n

1th prime - 2n
2th prime - 3n
3th prime - 5n
4th prime - 7n
5th prime - 9n
6th prime - 11n

35.6%

1th prime - 2n
2th prime - 3n
3th prime - 5n
4th prime - 7n

1th prime - 2n
2th prime - 3n
3th prime - 5n
4th prime - 7n

32.93%

The following code calculated the Prime Number upto the given range using the concept of Sieve method
The sieve of Eratosthenes is an ancient algorithm for finding all prime numbers up to any given limit. It does so by iteratively marking as composite the multiples of each prime, starting with the first prime number, 2. 7. What will be the output of the following code snippet?

```#include <stdio.h>
#include <stdlib.h>int main(){
int m = 2, c=1;
int n,a,b, limit=10;
while(c < limit)
{
for (int n = 1; n < m; ++n)
{
a = m * m - n * n;
b = 2 * m * n;
c = m * m + n * n;
if (c > limit)
break;
printf("%d %d %d\n", a, b, c);
}
m++;
}
}``` 1 5 7

1 5 7

8.96%

2 5 7
7 9 10

2 5 7
7 9 10

14.18%

1 2 3
4 5 6
7 8 9

1 2 3
4 5 6
7 8 9

23.86%

3 4 5
8 6 10

3 4 5
8 6 10

53.01%

The following code snippet generated Pythagorean triplets upto the given LIMIT 8. What will be the output of the following Code ?

```#include<stdio.h>
int main( )
{
int n=5, k, f1, f2, f;
if ( n < 2 )
return n;
else
{
f1 = f2 = 1;
for(k=2;k<n;k++)
{
f = f1 + f2;
f2 = f1;
f1 = f;
}
printf("%d",f) ;
}
}``` 8

8

16.89%

5

5

61.16%

13

13

14.12%

7

7

7.83%

The following code is generating Fibonacci series and returning the nth term 9. What purporse does the following code serves

```int main()
{
int array[] = {5, 3, 1, 9, 8, 2, 4, 7};
int size = sizeof(array)/sizeof(array);
int i, j, min_idx,temp;
for (i = 0; i < size-1; i++)
{
min_idx = i;
for (j = i+1; j < size; j++)
{
if (array[j] < array[min_idx])
min_idx = j;
}
temp = array[min_idx];
array[min_idx] = array[i];
array[i] = temp; }
}
``` Finds some specific element in the array

Finds some specific element in the array

10.92%

Sort the elements of array

Sort the elements of array

59.04%

Find the smallest element in the array

Find the smallest element in the array

25.74%

None of the above

None of the above

4.3%

Following code snippet is the code of selection sort, which compares each element of the array with all the other elements and arrange them in a specific order 10. What operation does the following pseudo code performs

```Declare an array of string type variable called word
Declare a loopcounter
Store a string in the array word
for loopcounter = (length of the word) – 1 to 0
loopcounter = loopcounter – 1
print arrayword[loopcounter]
endfor
Algorithm end``` It accepts a string

It accepts a string

8.9%

It reverses  the string

It reverses  the string

71.55%

It prints the string in the same order

It prints the string in the same order

15.14%

none of the above

none of the above

4.41%

The following pseudo code prints the entered string in the reverse order. We have used a reverse for loop, for reverse printing the string 11. What will be the output of the following pseudocode?

```#include<stdio.h>
int func(int a)
{
return a--;
}
int main()
{
int a= func(5);
printf("%d",a++);
return 0;
}
``` 4

4

26.42%

5

5

55.32%

7

7

4.68%

6

6

13.58%

When func() is called the function return value as 5 and it will be assigned to local variable a of main() function after that it will decrement the local variable a of func to 4. Now inside main function the value of a is printed as 5 and then it will increment to 6.
Hence option (B) is the correct answer 12. What will be the output of the following pseudocode?

```#include<stdio.h>

int main()
{
float m=3.0;
switch((int)m)
{
case 1:
printf("Prepinsta");
break;
case 2:
printf("Prime");
break;
case 3:
printf("Prepinsta Prime");
break;
}
return 0;
}

``` PrepInsta

PrepInsta

13.08%

Prime

Prime

8%

Prepinsta

Prepinsta

31.72%

error

error

47.2%

As we know switch argument allows only int value so after typecasting the variable m is converted to int type. Now the value passed will be 3 so case 3 will get executed and it will print Prepinsta prime as an output. 13. What will be the output of the following pseudo code?

#include

```#include<stdio.h>
int main()
{
int val=5;
do{
val++;
++val;
}while(val++>7);
printf("%d",val);
return 0;
}

``` 11

11

6.38%

10

10

8.72%

8

8

43.24%

7

7

41.66%

The value of variable val will increment 2 times so it becomes 7 after executing the body of do while loop. The variable val at while condition returns value as 7 and as we know 7>7 is false. So it will move outside the loop and after post increment the value of variable val becomes 8 which will be printed as an output. 14. What will be the output of the following pseudocode?

```#include<stdio.h>
int main()
{
int m=0;
if(m==0)
{
m=((5,(m=3)),m=1);
printf("%d",m);
}
else
printf("Test");
return 0;
}
``` Test

Test

25.55%

1

1

45.66%

3

3

9.11%

5

5

19.69%

Comma operator has a least priority and whenever comma operator present inside brackets then it will return the value present at the end. So the value of m will be 1. 15. What will be the output of the following pseudo code?

```#include<stdio.h>

void fun1(char *s1, char *s2)  {
char *tmp;
tmp = s1;
s1 = s2;
s2 = tmp;
}

void fun2(char **s1, char **s2)  {
char *tmp;
tmp = *s1;
*s1 = *s2;
*s2 = tmp;
}

int main ()  {
char *str1 = "Prepinsta", *str2 = "Prime";
fun1(str1, str2);     printf("%s %s ", str1, str2);
fun2(&str1, &str2);   printf("%s %s ", str1, str2);
return 0;
}
``` Prepinsta Prime Prime Prepinsta

Prepinsta Prime Prime Prepinsta

26.47%

Prime Prepinsta Prime Prepinsta

Prime Prepinsta Prime Prepinsta

30.29%

Prime Prepinsta Prepinsta Prime

Prime Prepinsta Prepinsta Prime

26.67%

Prepinsta Prime Prepinsta Prime

Prepinsta Prime Prepinsta Prime

16.57%

The first call to the function ‘func1(str1, str2);’ is call by value.
Hence, any change in the formal parameters are NOT reflected in actual parameters.
Hence, str1 points at “Prepinsta” and str2 points at “Prime”.
The second call to the function ‘func2(&str1, &str2);’ is call by reference.
Hence, any change in formal parameters are reflected in actual parameters.
Hence, str1 now points at “Prime” and str2 points at “Prepinsta”. 16. What will be the output of the following pseudo code ?

```#include<stdio.h>
void main()
{
int i=0;
while(+(+i--)!=0)
i=i+5;
printf("%d",i);
}
``` 5

5

39.02%

4

4

25.75%

-1

-1

32.2%

-2

-2

3.02%

Unary + is the only dummy operator in C. So it has no effect on the expression and now the while loop is, while(i--!=0) which is false and so breaks out of while loop. The value –1 is printed due to the post-decrement operator. 17. What will be the output of the following pseudo code ?

```#include<stdio.h>
int main()
{
char c= 'Z';
printf(“%d”,c);
}
``` Z

Z

12.76%

'Z'

'Z'

7.66%

90

90

43.78%

122

122

35.8%

Since the format specifier is integer format specifier - ‘%d’, the ASCII Value of character ‘Z’ will be printed as an output 18. What will be the output of the following pseudo code ?

```#include<stdio.h>
int func(int n)
{
int i=0;
while(n%10!=0)
{
n=n+3;
i++;
}
n=n-i;
return n;
}
void main()
{
printf("%d",func(35));
}
``` 50

50

13.08%

55

55

13.08%

53

53

11.17%

45

45

62.68%

Loop will execute for n=35,38,41,44,47,50.
Making i=5
So , 50-5=45. 19. What will be the output of the following pseudo code ?

```#include<stdio.h>
int func(int no)
{
static int count=0;
count=count+no;
return count;
}
void main()
{
int i,j;
for(i=0;i<=5;i++)
j=func(i);
printf("%d",j);
}

``` 18

18

8.06%

15

15

74.08%

20

20

9.53%

25

25

8.32%

At i=0 , count=0
i=1, count=1
i=2, count=3
i=3, count=6
i=4, count=10
i=5, count=15 20. What will be the output of the following pseudo code ?

```#include<stdio.h>

void main()
{
int a=5,b=2,c=1;
if(b>a && a>c && c>b)
b=a+1;
else
a=b+1;
printf("%d",a+b+c);
}
``` 6

6

83.88%

11

11

7.52%

19

19

3.71%

7

7

4.89%

Let’s check out the if condition => if(2>5 and 5>1 and 1>2) is False. So code inside else will be taken into account. a = b+1 => a = 3 Now, a+b+c => 3 + 2+1 => 6  ×

## FAQs on Pseudo Code Questions with Solutions

##### Question 1: How many Questions are there in Accenture Pseudo Code MCQ?
There are 18 Questions that need to solve in 40 min including both sections.
##### Question 2: What is the difficulty level of Pseudo Code Questions in the Test Paper?
The Difficulty level of the paper is high.You need to score atleast  70 percentile to clear next round.
##### Question 3:Which is the most important topic?
The most important topic is data structure and C.

## Get over 200+ course One Subscription

Courses like AI/ML, Cloud Computing, Ethical Hacking, C, C++, Java, Python, DSA (All Languages), Competitive Coding (All Languages), TCS, Infosys, Wipro, Amazon, DBMS, SQL and others

## Checkout list of all the video courses in PrepInsta Prime Subscription

• ET1049

Try to first check all ques. ans their option properly then upload , they have lot of mistakes in it. 1
• PrepInsta Support

Hey there
Thanks for commenting, kindly let us know about the mistakes in details with screen shots on 8448440710 whatsapp number, we will correct it. 1
• THORLAPATTI

in 19th qns:
#include
int func(int no)
{
static int count=0;
count=count+no;
return count;
}
void main()
{
int i,j;
for(i=0;i<=5;i++)
j=func(i);
printf("%d",j);
}
they didn't mention j += func(i) how it will become add to the previous count. every time they are adding i to count = 0; it will become 5 i think so. if any one give the explanation please. 0
• Abhishek

static keyword…!! 0
• PrepInsta Support

Hey there
Thanks for commenting, kindly let us know how can we help you? 0
• divyanisha2005

In question1 :
For input a = 5 & b = 5.
function (input a, input b)
If (a < b)
return function (b, a)
elseif (b != 0)
return (a * function (a, b – 1))
else
return 0

The function call for arguments a=5, b = 0 will return 0. So, final answer should be 0.
Correct me if I am wrong but I think the right options are not given in the options.
Thank you. 15
• sudarshanshelke25

in elseif loop there is condition for notequal to zero so loop will run for until codition false means equal to zero, 8
• ratna

yes i also get 0 3