Infosys Pseudo code Questions and Answers 2025

Infosys Pseudo Code Questions

Infosys Pseudo code Questions with Answers 2025 are available below on this page. Pseudo Code is a normal representation of algorithm code in C, C++ or any other language.

In Pseudo Code round there will be a total of 5 questions that we need to answer within 10 minutes. The Difficulty level of the paper goes from Moderate to High. For more detailed information on Infosys Examination, You can visit our Infosys Dashboard.

Infosys Pseudo Code Questions and Answers

Infosys Pseudo Code Questions with Answers 2025

Note: Pseudo Code are not the machine readable codes it is just as same as algorithm written in coding format.

Company Infosys
Total Time Duration 10 minutes
Number of Question 5 Ques
Negative Marking No

Tips for Solving Common Infosys Pseudocode Questions:

Infosys Pseudo Code Topics Details and Test Pattern:

TopicsNo. of questions in testSuggested Avg. TimeDifficulty
C1MedMedium
C++2MedMedium
OOPS2HighMedium

Prime Course Trailer

Related Banners

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

Sample Infosys Pseudo Code Questions with Solutions

1. What is the output?

#include<stdio.h>
int main()
{
    for (int x = 10; x >= 0; x--) {
        int z = x & (x >> 1);
        if (z)
            printf("%d ", x);
     }
    
}

7 6 3

7 6 3

43.37%

7 6 9

7 6 9

30.51%

678

678

16.39%

679

679

9.73%

Here, in the given code, >> is the bitwise right shift operator and x>>y => x/(2^y) and & is the bitwise and operator and gives 1 only if both bits are same. Now, for x = 10, (10>=0) z = 10 & (10>>1) => z = 10 & 5 => z=10. Similarly for x= 9, 8, 5, 4, 2, 1 and 0 , z will be zero and for x=7, z will be 3 , for x= 6, z will be 2 and for x=3, z will be 1 for x=7, 6, and 3 z is non zero so the will get printed on the output screen. Hence, we get output as 7 6 3

2. What is the output?

#include<stdio.h>
int main()
{
    int a = 100;
    printf("%0 %x", a);
}

%a

%a

9.48%

%x

%x

22.64%

100

100

34.08%

None

None

33.8%

In this question %0 will cancel out the a, while %x will get printed
but,
if we only write printf("%x"); without passing any parameter for x,
it will show an error.

3. What is the output?

#include<stdio.h>
int main() 
{
    typedef int num;
    num bunk = 0.00;    
    printf("%d", bunk);
    return 0;
    
}

Zero

Zero

34.52%

0.0

0.0

25.26%

garbage value

garbage value

22.05%

Logical Error

Logical Error

18.17%

Integer part of 0.00 is equal to 0.
Hence only zero will be printed with printf("%d", bunk), when 0.00 is passed, because %d stands for integer.

4. What is the output?

#include<stdio.h>
int main(){
    float x = 0.0;
    long int y = 10;
    printf("%d", sizeof(y) == sizeof(x+y));
    return 0;
}

1

1

23.09%

zero

zero

52.94%

4

4

12.61%

8

8

11.36%

sizeof(x), that is float, is 4
sizeof(y), that is long int, is 8
sizeof(x+y) that also comes out to be float will have size = 4

here it is asking sizeof(y) == sizeof(x+y)
i.e 8 == 4
"==" operator gives result in either 0 or 1
so answer is zero.

5. What is the output?

#include<stdio.h>
int main()
{
    int any = ' ' * 10;
    printf("%d", any);
    return 0;
}

320

320

59.43%

340

340

16.01%

360

360

19.16%

380

380

5.39%

Ascii value of space (' ') is 32 and 32 * 10 is 320

6. What will be the output of the following pseudocode:

#include<stdio.h>
int main()
{
int go = 5.0, num = 1*10;
do 
{
num /= go;
} while(go--);
printf ("%d\n", num);
return 0;
}

Floating Point Exception

Floating Point Exception

50.72%

Compilation Error

Compilation Error

29.85%

3 6 7

3 6 7

10.02%

None

None

9.4%

In C when you divide the integer with a float without the type casting it gives "Floating Point Exception" error

7.

What will be the output of following pseudo code

#include<stdio.h>
int main(){
    float x = 0.0;
    long int y = 10;
    printf("%d", sizeof(x) == sizeof(x+y));
    return 0;
}

1

1

20.6%

zero

zero

73.58%

4

4

4.15%

8

8

1.67%

sizeof(x) that is float is 4
sizeof(y) that is long int is 8
sizeof(x+y) that also comes out to be float will have size = 4

here it is asking sizeof(x) == sizeof(x+y)
i.e 4 == 4
"==" operator gives result in either 0 or 1
so answer is 1.

8. What will be the output of the following pseudocode:

#include <stdio.h>
int main()
{
    int num = 987;
    int rem;
    while(num!=0)
    {
        rem = num % 4;
        num = num / 10;
    }
    printf("%d",rem);
}

zero

zero

24.47%

1

1

36.76%

2

2

11.27%

3

3

27.5%

Iteration 1 : rem = 3(987 % 4), num = 98
Iteration 2 : rem = 2(98 % 4), num = 9
Iteration 3 : rem = 1(9 % 4), num = 0

9. what will be the output of the following Pseudo Code.

#include<stdio.h>
int main()
{
float i;
i = 1;
printf("%d",i);
return 0;
}

1

1

29.78%

Garbage Value

Garbage Value

20.48%

1.000000

1.000000

34.88%

Error

Error

14.85%

If float variable is declared as an integer type
then, it will always give garbage value.

10. What will be the output of the following pseudocode:

public class Main
{
     public static void main(String[] args)
     {
          String names[] = new String[5];
          for(int x=0; x<args.length; x++)
          names[x] = args[x];
          System.out.println(names[2]);
     }
}

Names

Names

14.53%

Null

Null

37.49%

Compilation fails

Compilation fails

20.45%

An exception throws at runtime

An exception throws at runtime

27.54%

value of args.length is 0
So, the loop will not run either of the time
Hence, null will be printed.

×

Please login to report

 

FAQ on Pseudo-Codes

What is pseudo code test?

Pseudo code is an another round in the Infosys hiring process. Their are total 5 questions and you have 10 minutes of time to complete the test. Its is a n MCQ question round where you have to predict the output of the code written in the pseudo-code format

What is pseudo coding?

Pseudo code is a term used to represent the codes in algorithmic format. These codes are not machine readable, but this are the algorithm representation of the code

Pesudo-codes are mainly written in which programming language?

Pesudo-Codes are the language free representation of the algorithm that explain the more coded format of the algorithm but not the complete representation of the code in any specific language

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

Checkout list of all the video courses in PrepInsta Prime Subscription

8 comments on “Infosys Pseudo code Questions and Answers 2025”