Top 10 Technical MCQ's With Answers TCS And Infosys | Programming And Coding MCQ's

In This Blog, I Have Covered the Top 10 MCQs Covered In the 2022 Year Of Questions And Answers.

This Question helps you to understand the pattern of the TCS NQT Programming Logic MCQ Question And Prepare Accordingly For TCS NQT 2023.

Mostly TCS Hire For Profile Like TCS Ninja And TCS Digital.


1. What is the use of & operator in C?

A. used ad pointer.

B. used As a data type

C. give address

D. All Of The Mentioned


Answer: C. Give Address.


2. To print a string without using printf() or putchar() function, which of the following will be used?

String: "hello world"


Options:

A. write(1,"hello world",11);

B. puts("hello world");

C. system("echo 'hello world'");

D. All of the mentioned


Answer: D. All of the mentioned


3. Product Revision is not related to...

Options:

A. Maintainability

B. Testability.

C. Flexibility 

D. Reusability.


Answer: D. Reusability


4. What will be the output of the program?

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


Options:

A. 0

B. 1

C. Run time error 

D. Garbage Value.


Answer: A. 0


5. A language has 28 different letters in total. Each word in the language is composed of max. 7 letter.
you want to create a data type to store a word of this language. You decide to store the word as an array.
How many bits will you assign to the data type to be able to store all kinds of words of the language?


Options:

A. 7

B. 35

C. 28

D. 196


Answer: B. 35


6. What is the output of the following?

public static void main(String[] args)
{
int var1=5;
int var2=6;
boolean b;
b=!(var1>var2);
Syste.out.print("Output is:" +b);
}


Options:

A. True

B. False


Answer: A. True.


7. What will be the output?

#include<stdio.h>
int main()
{
int a[3]={1,2,3};
printf("%d", 2[a]);
}


Options:

A. 1

B. 2

C. 3

D. Error


Answer:  C. 3


8. Find out the output of the following code?

#include<stdio.h>
int main()
{
int arr[]={2,0,1};
printf("%d",arr[arr[1]]);
return 0;
}


Options:

A. 0

B. 1

C. 2

D. Compilation Error.


Answer: C. 2


9. Predict the output of the following code?

#include<stdio.h>
int main()
{
if(printf("hi"))
 printf("Welcome");
else
 printf("Bye");
return 0;
}


Options:

A. Error

B. HiWelcome

C.HiBye

D. Bye


Answer: B. HiWelcome


10. Choose the output of the code

#include<stdio.h>
int main()
{
     int x=5, *p;
     p=&x;
 printf("%d", ++*p);
return 0;
}


Options:

A. 5

B. 6

C. 0

D. None


Answer: B. 6


Related Article:

Use Of & Operator In C

Post a Comment

0 Comments