Data structure MCQ Quiz Hub

Data Structure and Algorithms (DSA) set 3

Choose a topic to test your knowledge and improve your Data structure skills

The selection sort is basically a method of repeated





✅ Correct Answer: 3

In selection sort of n elements,how many times is the swp function called in the complete execution of the algorithm?





✅ Correct Answer: 2

If two string are identical then strcmp() function returns____





✅ Correct Answer: 3

How will you print on screen?





✅ Correct Answer: 4

Following function is used to find the first occurrence of given string in another string





✅ Correct Answer: 4

Which of the following is more appropriate for reading a multi_word string?





✅ Correct Answer: 4

What will be the output of the following code? Int main(){printf("Hello","Word ");return 0;}





✅ Correct Answer: 1

What will be the output of the following code? Int main(){char str[9]="My Computer";printf("%s ",str);return 0;}





✅ Correct Answer: 2

Pointer is a___________





✅ Correct Answer: 3

__operator is used to get the value stored at address stored in pointer variable





✅ Correct Answer: 1

Which of the following statement is true about char ****a ?





✅ Correct Answer: 2

Are *ptr++ and ++*ptr are same?





✅ Correct Answer: 1

Which of the following is a collection of different data type elements?





✅ Correct Answer: 2

Which of the following is a collection of different data type elements?





✅ Correct Answer: 2

Which of the following is a collection of different data type elements?





✅ Correct Answer: 2

What is the similarity between structure,union and enum?





✅ Correct Answer: 4

Which of the following can not be a structure member?





✅ Correct Answer: 3

The members of the union are accessed by____





✅ Correct Answer: 3

a-> is systematically correct if_____





✅ Correct Answer: 1

How many bits are absolutely necessary to store an ASCII character ?





✅ Correct Answer: 1

The result of 0001 1010 / 0001 0101 is





✅ Correct Answer: 1

The result of 0001 1010 & 0000 1000 is ___





✅ Correct Answer: 3

The result of 0001 1010 ~ 0100 0011 is





✅ Correct Answer: 2

The result of 0001 1010^0001 0000 is____





✅ Correct Answer: 3

The result of 0001 1010 << 2 is____





✅ Correct Answer: 2

The result of 0001 1010 >>2 is____





✅ Correct Answer: 3

The most significant bit is lost in following operation





✅ Correct Answer: 1

The result of i)true AND false II)false or false





✅ Correct Answer: 4

What will be output if you will compile and execute the following c code? #include<stdio.h> int main(){ int i=320; char *ptr=(char *)&i; printf("%d",*ptr); return 0; }





✅ Correct Answer: 3

What will be output if you will compile and execute the following c code? #include<stdio.h> #define x 5+2 int main(){ int i; i=x*x*x; printf("%d",i); return 0; }





✅ Correct Answer: 2

What will be output if you will compile and execute the following c code? #include<stdio.h> int main(){ char c=125; c=c+10; printf("%d",c); return 0; }





✅ Correct Answer: 3

What will be output if you will compile and execute the following c code? #include<stdio.h> int main(){ float a=5.2; if(a==5.2) printf("Equal"); else if(a<5.2) printf("Less than"); else printf("Greater than"); return 0; }





✅ Correct Answer: 2

What will be output if you will compile and execute the following c code? #include<stdio.h> int main(){ int i=4,x; x=++i + ++i + ++i; printf("%d",x); return 0; }





✅ Correct Answer: 1

What will be output if you will compile and execute the following c code? #include<stdio.h> int main(){ int a=2; if(a==2){ a=~a+2<<1; printf("%d",a); } else{ break; } return 0;





✅ Correct Answer: 4

What will be output if you will compile and execute the following c code? #include<stdio.h> int main(){ int a=10; printf("%d %d %d",a,a++,++a); return 0; }





✅ Correct Answer: 1

What will be output if you will compile and execute the following c code? #include<stdio.h> int main(){ char *str="Hello world"; printf("%d",printf("%s",str)); return 0; }





✅ Correct Answer: 4

What will be output if you will compile and execute the following c code? #include <stdio.h> #include <string.h> int main(){ char *str=NULL; strcpy(str,"cquestionbank"); printf("%s",str); return 0; }





✅ Correct Answer: 3

#include <stdio.h> #include <string.h> int main(){ int i=0; for(;i<=2;) printf(" %d",++i); return 0; }





✅ Correct Answer: 3

What will be output if you will compile and execute the following c code? #include<stdio.h> int main(){ int x; for(x=1;x<=5;x++); printf("%d",x); return 0; }





✅ Correct Answer: 3

What will be output if you will compile and execute the following c code? #include<stdio.h> int main(){ printf("%d",sizeof(5.2)); return 0; }





✅ Correct Answer: 3

What will be output if you will compile and execute the following c code? #include <stdio.h> #include <string.h> int main(){ char c='8'; printf("%d",c); return 0; }





✅ Correct Answer: 4

What will be output if you will compile and execute the following c code? #include<stdio.h> #define call(x,y) x##y int main(){ int x=5,y=10,xy=20; printf("%d",xy+call(x,y)); return 0; }





✅ Correct Answer: 4

What will be output if you will compile and execute the following c code? #include<stdio.h> int * call(); int main(){ int *ptr; ptr=call(); printf("%d",*ptr); return 0; } int * call(){ int a=25; a++; return &a; }





✅ Correct Answer: 4

. What is error in following declaration? struct outer{ int a; struct inner{ char c; }; };





✅ Correct Answer: 3

What will be output if you will compile and execute the following c code? #include<stdio.h> int main(){ int array[]={10,20,30,40}; printf("%d",-2[array]); return 0; }





✅ Correct Answer: 2

What will be output if you will compile and execute the following c code? #include<stdio.h> int main(){ int i=10; static int x=i; if(x==i) printf("Equal"); else if(x>i) printf("Greater than"); else printf("Less than"); return 0; }





✅ Correct Answer: 4

What will be output if you will compile and execute the following c code? #include<stdio.h> #define max 5; int main(){ int i=0; i=max++; printf("%d",i++); return 0; }





✅ Correct Answer: 4

What will be output if you will compile and execute the following c code? #include<stdio.h> int main(){ double far* p,q; printf("%d",sizeof(p)+sizeof q); return 0; }





✅ Correct Answer: 1

C language was invented by





✅ Correct Answer: 4

The data type created by the data abstraction process is called





✅ Correct Answer: 3

A variable which is visible only in the function in which it is defined, is called





✅ Correct Answer: 4

Unsigned integers occupies





✅ Correct Answer: 3

Which of the following data structure is linear type ?





✅ Correct Answer: 4

Which of the following data structure is linear type ?





✅ Correct Answer: 4

In C, if you pass an array as an argument to a function, what actually gets passed?





✅ Correct Answer: 3

Which data structure allows deleting data elements from front and inserting at rear?





✅ Correct Answer: 2

Queue is a -------------- List .





✅ Correct Answer: 1

A node in a linked list must contain at least





✅ Correct Answer: 2

An algorithm is made up of two independent time complexities f (n) and g (n). Then the complexities of the algorithm is in the order of





✅ Correct Answer: 2

Big O notation is defined for





✅ Correct Answer: 1