# Accenture Pseudo Code Question and Answer

## Accenture PseudoCode Questions 2020 for Freshers

Accenture PseudoCode Test Questions with Answers 2020 are discussed below. Pseudo Code is mainly based on Input Output Form contain some programming languages c,c++ etc.In pseudo Code round there will be total 10 questions and the time limit will be 30 min including other section.Ther Difficulty level of the paper is high.Pseudo Code is mainly based on Input Output Form contain some programming languages c,c++ etc. For more detailed information you can visit to the Accenture Dashboard. ## Accenture PseudoCode Question and Answer

 Company Accenture Total Time Duration 30 minutes Number of Question 10 Ques Negative Marking No

## Accenture PseudoCode Questions 2020 for Freshers

Accenture PseudoCode Test Questions with Answers 2020 are discussed below. Pseudo Code is mainly based on Input Output Form contain some programming languages c,c++ etc.In pseudo Code round there will be total 10 questions and the time limit will be 30 min including other section.Ther Difficulty level of the paper is high.Pseudo Code is mainly based on Input Output Form contain some programming languages c,c++ etc. For more detailed information you can visit to the Accenture Dashboard. ## Accenture PseudoCode Question and Answer

 Company Accenture Total Time Duration 30 minutes Number of Question 10 Ques Negative Marking No

## Detailed Accenture Pseudo Code Paper Pattern

TopicsNo. of questions in testSuggested Avg. TimeDifficulty
C2MedMedium
C++3MedMedium
OOPS3HighMedium
Data Structure2HighMedium

## 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

13.98%

625

625

29.71%

3125

3125

42.93%

525

525

13.38%

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

15.19%

97

97

40.4%

a

a

10.49%

error

error

33.92%

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.81%

315

315

10.56%

320

320

10.48%

337

337

65.15%

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 and array of size n
accept the values for the array
for o 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

38.64%

3 5 7 9 11

3 5 7 9 11

20.37%

3 5 9 15 20

3 5 9 15 20

6.09%

error

error

34.9%

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)

16.05%

1

1

11.33%

2

2

65%

3

3

7.62%

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.58%

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

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

18.24%

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

34.41%

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

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

37.76%

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 if the value of 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

12.85%

2 5 7
7 9 10

2 5 7
7 9 10

18.06%

1 2 3
4 5 6
7 8 9

1 2 3
4 5 6
7 8 9

39.81%

3 4 5
8 6 10

3 4 5
8 6 10

29.28%

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

15.69%

5

5

63.21%

13

13

12.87%

7

7

8.24%

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

7.65%

Sort the elements of array

Sort the elements of array

64.88%

Find the smallest element in the array

Find the smallest element in the array

24.67%

None of the above

None of the above

2.79%

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

6.58%

It reverses  the string

It reverses  the string

75.64%

It prints the string in the same order

It prints the string in the same order

13.4%

none of the above

none of the above

4.38%

The following pseudo code prints the entered string in the reverse order. We have used a reverse for loop, for reverse printing the string ×

### Question. How many Questions are there in Accenture Pseudo Code MCQ?

There are 10 Questions that need to solve in 30 min including both sections.

### 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.

### What is the most important topic?

The The most important topic is data structure and C.