TCS Miscllaneous Questions Quiz-1

Question 1

Time: 00:00:00
Ques. 1 Which is the character array used to accept command line arguments?

char argv

char argv

char* argv[]

char* argv[]

char argv[]

char argv[]

char* argv

char* argv

Once you attempt the question then PrepInsta explanation will be displayed.

Please login to submit your explanation

PrepInsta User

char* argv[]

PrepInsta User

char* argv[]

Question 2

Time: 00:00:00
What is a dangling pointer?

points to garbage value

points to garbage value

points to address

points to address

points to nothing

points to nothing

none of the above

none of the above

Once you attempt the question then PrepInsta explanation will be displayed.

Please login to submit your explanation

Question 3

Time: 00:00:00
Which is not a string function?

strstr

strstr

strcmp

strcmp

strupr

strupr

strchr

strchr

Once you attempt the question then PrepInsta explanation will be displayed.

Please login to submit your explanation

PrepInsta User

strchr should be the answer

PrepInsta User

strupr function is used to converts a given string to uppercase.

PrepInsta User

The C Strupr function is one of the String Function, which is used to convert the given characters or string into Uppercase letters.

PrepInsta User

The strstr() function searches the given string in the specified main string and returns the pointer to the first occurrence of the given string.

PrepInsta User

strchr() is a predefined function used for finding occurrence of a character in a string. It is present in cstring header file.

PrepInsta User

The strcmp() function is used to compare two strings two strings str1 and str2

PrepInsta User

strupr only supports in c++

Question 4

Time: 00:00:00
Which of the following does not require to include math.h header file?

pow()

pow()

rand()

rand()

sqrt()

sqrt()

sinh()

sinh()

Once you attempt the question then PrepInsta explanation will be displayed.

Please login to submit your explanation

Question 5

Time: 00:00:00
What is the task of pre-processor?

Expanding

Expanding

Compiling

Compiling

Linking

Linking

All of the above

All of the above

Once you attempt the question then PrepInsta explanation will be displayed.

Please login to submit your explanation

Question 6

Time: 00:00:00
Which of the following is true?

realloc() can change the memory size of arrays

realloc() can change the memory size of arrays

Unary operator works on only one operand

Unary operator works on only one operand

Struct and Union works in same way.

Struct and Union works in same way.

None of the above

None of the above

Once you attempt the question then PrepInsta explanation will be displayed.

Please login to submit your explanation

Question 7

Time: 00:00:00
Which of this is used to skip one iteration:

break

break

continue

continue

goto

goto

return

return

Once you attempt the question then PrepInsta explanation will be displayed.

Please login to submit your explanation

Question 8

Time: 00:00:00
Which address does a pointer to an array store:

Memory address of the first element of the array

Memory address of the first element of the array

Memory address of the second element of the array

Memory address of the second element of the array

Memory address of the third element of the array

Memory address of the third element of the array

Memory address of the fourth element of the array

Memory address of the fourth element of the array

Once you attempt the question then PrepInsta explanation will be displayed.

Please login to submit your explanation

PrepInsta User

what is this only one option? Correct it.

Question 9

Time: 00:00:00
Predict the output:
float a = 0.1;
if(a==0.1)
printf(“Yes”);
else
printf(“No”)

Yes

Yes

No

No

Once you attempt the question then PrepInsta explanation will be displayed.

Please login to submit your explanation

Question 10

Time: 00:00:00
Another output based question which basically displayed the input string in reverse pattern.

For example, ABRACADABRA was displayed as ARBADACARBA.

Comment on the below while statement

while(0 == 0) { }

It has syntax error as there are no statements within braces {}

It has syntax error as there are no statements within braces {}

It will run for ever

It will run for ever

It compares 0 with 0 and since they are equal it will exit the loop immediately

It compares 0 with 0 and since they are equal it will exit the loop immediately

It has syntax error as the same number is being compared with itself

It has syntax error as the same number is being compared with itself

Once you attempt the question then PrepInsta explanation will be displayed.

Please login to submit your explanation

["0","40","60","80","100"]
["Need more practice!","Keep trying!","Not bad!","Good work!","Perfect!"]

Buy TCS Prog. Logic (C MCQ) Paid Materials

Join TCS Online Classes

Personalized Analytics only Availble for Logged in users

Analytics below shows your performance in various Mocks on PrepInsta

Your average Analytics for this Quiz

Rank

-

Percentile

0%

Get over 200+ Courses under One Subscription

mute

Don’t settle Learn from the Best with PrepInsta Prime Subscription

Learn from Top 1%

One Subscription, For Everything

The new cool way of learning and upskilling -

Limitless Learning

One Subscription access everything

Job Assistance

Get Access to PrepInsta Prime

Top Faculty

from FAANG/IITs/TOP MNC's

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.

Comments