what is the first output corresponding to the following pseudocode if the user inputs 2, 3, 4, 5?

Accenture PseudoCode Questions 2022 for Freshers

Accenture PseudoCode Test Questions with Answers 2022 are discussed below. Pseudo Code is mainly based on Input Output Form contain some programming languages c,c++ etc.In pseudo Code circular in that location volition be total xviii questions and the fourth dimension limit volition be eighteen mins .The difficulty level of the paper is loftier.Pseudo Code is mainly based on Input Output Class comprise some programming languages C/CPP etc.

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

Accenture Pseudocode Question and Answer 2020

Accenture PseudoCode Question and Reply

Visitor Accenture
Total Time Duration 18 minutes
Number of Question 18 Ques
Negative Marking No

Accenture PseudoCode Questions 2022 for Freshers

Accenture PseudoCode Test Questions with Answers 2022 are discussed beneath. Pseudo Code is mainly based on Input Output Course comprise some programming languages c,c++ etc.In Pseudo Code round there will be total 18 questions and the time limit volition be 18 mins specifically for pseudo code.The difficulty level of the paper is loftier.Pseudo Code is mainly based on Input Output Class contain some programming languages c,c++ etc.

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

Accenture Pseudocode Question and Answer 2020

Accenture PseudoCode Question and Answer

Company Accenture
Full Time Elapsing 18 minutes
Number of Question 18 Ques
Negative Marking No

Accenture Pseudo Code Curriculum

Detailed Accenture Pseudo Code Paper Pattern

Topics No. of questions in exam Suggested Avg. Time Difficulty
C two Med Medium
C++ three Med Medium
OOPS three High Medium
Data Structure 2 High Medium

Practice from Accenture Sample Pseudo Code Questions

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

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

function(v,5) will return five 10 office(v,4)

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

function(5,3) volition return 5 x v x 5 x function(five,2)

function(5,2) will return 5 x 5 ten 5 x v role(5,1)

office(5,0) volition return 5 x 5 x 5 x five ten 5 = 3125

2. What will be the output of the post-obit pseudo lawmaking

initialize char c set c= a impress "%d",a

The code will print the ASCII value of the entered graphic symbol

3. What volition be the output of the following lawmaking ?

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

The following code volition add the ASCII values of the given characters
f = 102
south = 115
x = 120
sum = 102+115+120 = 337

iv. What will be the output of the following pseudo code for arr[]= 1,2,3,4,five

initialize i,n intialize an assortment of size northward   have the values for the assortment for i= 0 to n   arr[i] = arr[i]+arr[i+i] end for print the array elements

The following pseudo code will add the first element with the second, the second chemical element with the third, the third element with the fourth and the fourth element with the fifth, the 5th element volition 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,due north;   i=5;   n=7;   int f = fun(v,seven);   printf("%d", f); }  int fun(int x, int y) {   if(x<=0)   return y;   else   return(fun(ten-1,y-1)); }

This is a recursive code the function fun(int x, int y) will keep on calling itself until the value of x becomes nada, and when the base condition executes it will print the value of y
Since the value of x is five and information technology is getting decremented by 1 on every part phone call and the value of y is too getting decremented past i on every office telephone call. On the execution of base condition the value of 10 will get 0(equally it has been decremented by one, v times) and the value of y will become 2(as it is besides has been decremented by ane, 5 times) and hence the output will be 2

half-dozen. What volition be the output of the following lawmaking

#include <stdio.h> #include <stdlib.h> #define LIMIT ten /*size of integers array*/ int main(){     unsigned long long int i,j;     int *primes;     int z = one;     primes = malloc(sizeof(int)*LIMIT);     for (i=2;i<LIMIT;i++)       primes[i]=1;     for (i=two;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\northward",z++,i);   return 0;  }

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

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

21.94%

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

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

34.68%

1th prime - 2n
2th prime - 3n
3th prime number - 5n
fourth prime number - 7n

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

33.75%

The post-obit code calculated the Prime Number upto the given range using the concept of Sieve method
The sieve of Eratosthenes is an aboriginal algorithm for finding all prime numbers upward to any given limit. It does so by iteratively marking as composite the multiples of each prime, starting with the get-go prime number, ii.

7. What volition be the output of the following code snippet?

#include <stdio.h> #include <stdlib.h>int main(){ int thousand = 2, c=1; int n,a,b, limit=x; while(c < limit) { for (int n = 1; n < m; ++n) { a = m * thou - n * n; b = two * m * n; c = m * m + n * n; if (c > limit) intermission; printf("%d %d %d\due north", a, b, c); } m++; } }

The following code snippet generated Pythagorean triplets upto the given LIMIT

8. What will exist 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(thou=two;k<n;yard++)       {         f = f1 + f2;         f2 = f1;         f1 = f;       }     printf("%d",f) ;   } }

The following code is generating Fibonacci series and returning the nth term

nine. What purporse does the post-obit code serves

int main()  {    int array[] = {5, three, 1, 9, viii, 2, 4, 7};    int size = sizeof(array)/sizeof(assortment[0]);   int i, j, min_idx,temp;         for (i = 0; i < size-one; i++)       {           min_idx = i;           for (j = i+ane; j < size; j++)         {         if (array[j] < array[min_idx])               min_idx = j;           }               temp = assortment[min_idx];               array[min_idx] = assortment[i];                array[i] = temp; } }                        

Finds some specific element in the array

Finds some specific element in the array

11.25%

Sort the elements of assortment

Sort the elements of array

57.84%

Find the smallest element in the assortment

Find the smallest element in the array

26.74%

Following code snippet is the code of choice sort, which compares each element of the array with all the other elements and arrange them in a specific lodge

ten. What functioning does the post-obit pseudo code performs

Declare an array of string type variable called discussion Declare a loopcounter Store a string in the array give-and-take for loopcounter = (length of the word) – ane to 0   loopcounter = loopcounter – i   print arrayword[loopcounter] endfor Algorithm end

It accepts a string

It accepts a string

9.38%

It reverses  the string

It reverses  the string

69.xix%

It prints the string in the same social club

It prints the cord in the same lodge

16.88%

The following pseudo lawmaking prints the entered string in the reverse society. We have used a reverse for loop, for contrary printing the string

11. What volition exist the output of the post-obit pseudocode?

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

When func() is called the office render value as 5 and it will be assigned to local variable a of chief() office after that it will decrement the local variable a of func to 4. Now inside main function the value of a is printed equally five and then it will increment to half-dozen.
Hence option (B) is the correct answer

12. What volition be the output of the following pseudocode?

#include<stdio.h>  int principal() {     float m=3.0;     switch((int)m)     {         case 1:                 printf("Prepinsta");                 break;         case two:                 printf("Prime");                 break;         case 3:                 printf("Prepinsta Prime");                 interruption;     }     render 0; }                        

Equally we know switch argument allows merely int value and so after typecasting the variable 1000 is converted to int type. Now the value passed will be 3 and then case 3 will go executed and information technology will print Prepinsta prime equally an output.

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

#include

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

The value of variable val volition increment 2 times so it becomes seven afterwards executing the torso of exercise while loop. The variable val at while condition returns value as 7 and as we know 7>7 is imitation. And so it will move outside the loop and subsequently postal service increment the value of variable val becomes 8 which will be printed as an output.

14. What will exist the output of the following pseudocode?

#include<stdio.h> int main() {     int m=0;     if(g==0)     {         m=((five,(m=three)),one thousand=one);         printf("%d",grand);     }     else      printf("Exam");     render 0; }                        

Comma operator has a least priority and whenever comma operator nowadays inside brackets then it will render the value present at the end. So the value of m volition be i.

15. What volition exist 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("%south %s ", str1, str2);       fun2(&str1, &str2);   printf("%south %due south ", str1, str2);       render 0;  }                        

Prepinsta Prime number Prime Prepinsta

Prepinsta Prime Prime Prepinsta

25.39%

Prime Prepinsta Prime Prepinsta

Prime number Prepinsta Prime Prepinsta

31.47%

Prime Prepinsta Prepinsta Prime

Prime Prepinsta Prepinsta Prime

25.63%

Prepinsta Prime Prepinsta Prime

Prepinsta Prime Prepinsta Prime

17.52%

The first call to the function 'func1(str1, str2);' is call past value.
Hence, whatsoever alter 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 alter in formal parameters are reflected in bodily parameters.
Hence, str1 now points at "Prime number" and str2 points at "Prepinsta".

16. What will exist the output of the following pseudo code ?

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

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 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); }                        

Since the format specifier is integer format specifier - '%d', the ASCII Value of character 'Z' will be printed every bit an output

18. What will be the output of the following pseudo lawmaking ?

#include<stdio.h> int func(int northward) {     int i=0;     while(n%ten!=0)     {         due north=north+three;         i++;     }     northward=n-i;     return north; } void main() {     printf("%d",func(35)); }                        

Loop volition execute for n=35,38,41,44,47,50.
Making i=5
So , 50-v=45.

xix. 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); }                        

At i=0 , count=0
i=one, count=1
i=two, count=3
i=3, count=6
i=four, count=x
i=v, count=15

twenty. What will exist the output of the following pseudo lawmaking ?

#include<stdio.h>  void master() {     int a=5,b=2,c=1;     if(b>a && a>c && c>b)         b=a+i;     else          a=b+ane;     printf("%d",a+b+c); }                        

Let's check out the if condition => if(2>5 and 5>ane and 1>ii) is False. So lawmaking within else volition be taken into account. a = b+one => a = 3 Now, a+b+c => 3 + 2+one => 6

Boosted Data (FAQ'southward)

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

In that location are ten Questions that demand to solve in 30 min including both sections.

What is the difficulty level of Pseudo Code Questions in the Examination Paper?

The Difficulty level of the paper is high.You need to score atleast  70 percentile to clear next circular.

What is the most important topic?

The The nearly important topic is data construction and C.

roycaughly.blogspot.com

Source: https://prepinsta.com/accenture/pseudo-code/

0 Response to "what is the first output corresponding to the following pseudocode if the user inputs 2, 3, 4, 5?"

Postar um comentário

Iklan Atas Artikel

Iklan Tengah Artikel 1

Iklan Tengah Artikel 2

Iklan Bawah Artikel