SlideShare uma empresa Scribd logo
1 de 7
Baixar para ler offline
T: 2H
1
C and Data Structure
1. The operator & is used for
1. Bitwise AND
2. Bitwise OR
3. Logical AND
4. Logical OR
2. Built-in data structures in „C‟ are
1. Arrays
2. Structures
3. Files
4. All of the above
3 .The size of a character variable in „C‟ is
1. 4 byte
2. 8 bytes
3. 16 bytes
4. None of the above
4. What is the output of the following program segment?
#include<stdio.h>
main()
{
int i=10, m=10;
clrscr();
printf(“%d”, i>m?i*i:m/m,20);
getch();
}
1. 20
2. 1
3. 120
4. 100 20
5. Data type of the controlling statement of a SWITCH statement cannot of the type:
1. int
2. char
3. short
4. float
6. How long the following loop runs:
for (x=0; x=3; x++)
1. Three time
2. Four times
3. Forever
4. Never
7. An expression contains assignment, relational and arithmetic operators. If parentheses
are not specified, the order of evaluation of the operators would be:
1. assignment, arithmetic, relational
2. relational, arithmetic, assignment
3. assignment, relational, arithmetic
4. arithmetic, relational, assignment
8. The CONTINUE statement cannot be used with
1. for
2. switch
3. do
4. while
9. Output of the following program will be:
main( )
{
int a [ ] = {1, 2, 9, 8, 6, 3, 5, 7, 8, 9};
int *p = a+1;
int *q = a+6;
printf (“n%d”, q-p);
MM:50
2
}
1. 9
2. 5
3. 2
4. None of the above
10. Size of the following union (assume size of int=2; size of float=4 and size of char = 1):
union Jabb
{
int a;
float b;
char c;
};
1. 2
2. 4
3. 1
4. 7
11. int z, x=5, y=-10, a=4, b=2;
z=x++ - --y * b / a;
What will be the final value of z?
1. 5
2. 6
3. 10
4. 11
12. With every use of memory allocation function, what function should be used to release
allocated memory which is no longer needed?
1. dropmem( ) 2. dealloc( )
3. release( ) 4. free( )
13. int warr[3][2][2] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12};
What will be the value of warr[2][1][0]?
1. 5
2. 7
3. 9
4. 11
14. char *ptr;
char myString[ ] = “abcdefg”;
ptr = myString;
ptr += 5;
The pointer ptr points to which string?
1. fg
2. efg
3. defg
4. cdefg
15. Suppose that x is initialized as:
short int x; /* assume x is 16 bits in size */
What is the maximum number that can be printed using printf (“%dn”, x),
1. 127
2. 128
3. 255
4. 32,767
16. When applied to a variable, what does the unary “&” operator yield?
1. The variable‟s address
2. The variable‟s right value
3. The variable‟s binary form
4. The variable‟s value
3
17. How is a variable accessed from another file?
1. via the extern specifier.
2. via the auto specifier.
3. via the global specifier.
4. via the pointer specifier.
18. What does the following function print?
func(int i)
{if(i%2) return 0;
else return 1;}
main( )
{
int=3;
i=func(i);
i=func(i);
printf(“%d”, i);
}
1. 3
2. 1
3. 0
4. 2
19. Given the piece of code
int a[50];
int *pa;
pa=a;
To access the 6th
element of the array which of the following is incorrect?
1. *(a+5)
2. a[5]
3. pa[5]
4. *(*pa + 5)
20. Regarding the scope of the variables; identify the incorrect statement:
1. automatic variables are automatically initialized to 0
2. static variables are automatically initialized to 0
3. the address of a register variable is not accessible
4. static variables cannot be initialized with any expression
21. Given the following code fragment:
void main(voi4.
{
char x = „0‟;
char n = „N‟;
printf(“%u” ”%sn”, &n, &n);
}
What will be the result of execution?
1. ddddd N ( where d represents any digit)
2. 78 N
3. 78 garbage
4. compilation error
22. Given the following code fragment:
int main(voi4.
{
int raw[20], i, sum=0;
int *p = raw;
for (i=0; i < 20; i++)
4
*(p+i) = I;
for(i=0; i < 20; I += sizeof(int))
sum += *(p+i)
printf(“sum = %dn”, sum);
return();
}
What will be the result of execution?
1. sum = 10
2. sum = 40
3. sum = 60
4. sum = 190
23. What is the missing statement in the following function which copies string x into string y
void strcpy( char *x, char *y)
{
while (*y != „0‟)
………………… /* missing stament */
*x = „0‟;
}
1. x = y
2. *x++ = *y++
3. (*x)++ = (*y)++
4. none of the above
24. Consider the following program,
main( )
{
int x = 49;
for(;x;)
x--;
printf(“%dn”, x);
}
the output of the program will be
1. 49
2. 0
3. -49
4. none of the above
25. # define dp(e) printf(#e “ = %dn”,e)
main( )
{
int x =3, y = 2;
dp(x/y)
}
What will be the output of the program?
1. prints x/y = 1
2. prints #e = 1. 5
3. prints #x/y = 1
4. none of the above
26 . Assume that i, j and k are integer variables and their values are 8, 5 and 0 respectively.
What will be the values of variables i and k after executing the following expressions?
k = ( j > 5) ? ( i < 5) ? i-j: j-i: k-j;
i -= (k) ? (i) ? (j): (i): (k);
1. -3 and 3
2. 3 and -5
3. 3 and -3
4. -5 and 3
5
27. The && and | | operators
1. compare two numeric values
2. combine two numeric values
3. compare two boolean values
4. none of the above
28. An external variable is one
1. Which resides in the memory till the end of the program
2. Which is globally accessible by all functions
3. Which is declared outside the body of any function
4. All of the above
29. Find the error in the following program:
main( )
{
int m;
char g;
switch(m)
{
case 5 : grade=”P”;break;
case 2 : grade=”Q”;break;
case 2 : grade=”R”;break;
default : grade=”S”;break;
}
}
1. No two labels may be identical
2. switch statement cannot have more than three labels
3. case label cannot be numbers
4. none of the above
30. Consider the following program:
main( )
{
char *k=”xyz;
f(k);
printf(“%sn”,k);
}
f(char *k)
{ k = malloc(4); strcpy(k, “pq”); }
What will be the output?
1. pq
2. xyz
3. syntax error
4. none of the above
31. Time complexity of insertion sort algorithm in the best case is
1. O(n)
2. O(n log2 n)
3. O(n2
)
4. none of the above
32. In linked list representation, a node contains at least
1. node address field, data field
2. node number, data field
3. next address field, information field
4. none of the above
6
33. Which of the following statements are true:
1. binary search is always better than sequential search.
2. binary search is better than sequential search when
number of elements is small.
3. binary search is better than sequential search when
number of elements is very large.
4. binary search is always inferior to sequential search.
34 In an 16-bit computer, 30 digit integer can be stored in
1. an integer variable
2. floating point variable
3. a circular list
4. none of the above
35 A stack can be used to
1. allocate resources by the operating system
2. to schedule jobs on round-robin basis
3. process procedure call in a program
4. none of the above
36. An ordered set of items from which items may be deleted at either end and into which
items may be inserted at either end is called.
1. Queue
2. Stack
3. Heap
4. Dequeue
37. The property of hash function is that
1. it minimizes the rate of overflow
2. it preserves the order of key values.
3. it minimizes number of collisions.
4. none of the above.
38. The number of comparisons needed to merge-sort a list of n elements is
1. O(n log n)
2. O(n log log n)
3. O(n)
4. O(n log n2
)
39. In the text of the divide and conquer algorithm must contain at least
1. One recursive call
2. Two recursive calls
3. Either one or zero calls
4. None of the above
40. In a stack, top=0 denotes that
1. stack is empty
2. stack is full
3. top has no element
4. none of the above
41. The correct increasing order of magnitude of computing time is-
1. O(1) < O(logn) < O(n) < O(n logn) < O(n2
) < O(n3
) < O(2n
)
2. O(2n
) < O(n3
) < O(n2
) < O(n logn) < O(n) < O(logn) O(1)
3. O(logn) < O(n logn) < O(n) < O(n2
) < O(n3
) < O(2n
) < O(1)
4. None of the above
42. Suppose the union is declared like
union
{
float x;
7
char c[10];
int y;
}num;
Assuming that float requires 4 bytes, char requires 1 byte and int requires 2 bytes, the memory
space used by the variable num is
1. 16 bytes
2. 10 bytes
3. 4 bytes
4. 7 bytes
43. Which data structure is implemented in automatic variable declaration?
1. Queue
2. Stack
3. Heap
4. Graph
44. If j=2, m=1, x=3, y=4. What is the value of the expression j++ = = m = = y * x
1. 0
2. 1
3. 2
4. 3
45. Which of the following data structure may give overflow error, even though the current number
of elements in it, is less than its size
1. simple queue
2. circular queue
3. stack
4. none of the above
46. Which one is not correct?
1. Pointers are used for dynamically allocating memory.
2. Dynamic memory allocation is preferred when storage requirement is not predictable.
3. Data access in dynamically allocated storage is faster than static allocated storage.
4. None of the above
47. Which of the following cannot be performed recursively?
1. Binary Search
2. Quick Sort
3. Depth First Search
4. None of the above
48. “p” is a pointer to the structure. A member “mem” of that structure is referenced by
1. *p.mem
2. (*p).mem
3. *(p.mem)
4. None of the above
49. If the file contains data (61, 41, 91, 11) then the most suitable sorting technique is–
1. Quick sort
2. Radix sort
3. Insertion sort
4. None of the above
50. If there are total n nodes, then memory compaction requires
1
. O (log2 n) steps
2. O (n) steps
3. O (n2
) steps
4. None of the above

Mais conteúdo relacionado

Mais procurados

Java orientação a objetos (interfaces)
Java   orientação a objetos (interfaces)Java   orientação a objetos (interfaces)
Java orientação a objetos (interfaces)
Armando Daniel
 
Dynamic Binding in C# 4.0
Dynamic Binding in C# 4.0Dynamic Binding in C# 4.0
Dynamic Binding in C# 4.0
Buu Nguyen
 

Mais procurados (20)

C MCQ
C MCQC MCQ
C MCQ
 
Algo poo ts
Algo poo tsAlgo poo ts
Algo poo ts
 
UGC-NET, GATE and all IT Companies Interview C++ Solved Questions PART - 1
UGC-NET, GATE and all IT Companies Interview C++ Solved Questions PART - 1 UGC-NET, GATE and all IT Companies Interview C++ Solved Questions PART - 1
UGC-NET, GATE and all IT Companies Interview C++ Solved Questions PART - 1
 
資管所數位邏輯補充考卷(適用交大、政大、中山、成大)
資管所數位邏輯補充考卷(適用交大、政大、中山、成大)資管所數位邏輯補充考卷(適用交大、政大、中山、成大)
資管所數位邏輯補充考卷(適用交大、政大、中山、成大)
 
C++ Programming
C++ ProgrammingC++ Programming
C++ Programming
 
BEd Multiple choice questions 205-17 Biology Set- 4
BEd Multiple choice questions 205-17 Biology Set- 4BEd Multiple choice questions 205-17 Biology Set- 4
BEd Multiple choice questions 205-17 Biology Set- 4
 
Function overloading ppt
Function overloading pptFunction overloading ppt
Function overloading ppt
 
OOM MCQ 2018
OOM  MCQ 2018OOM  MCQ 2018
OOM MCQ 2018
 
Technical questions
Technical questionsTechnical questions
Technical questions
 
C mcq practice test 4
C mcq practice test 4C mcq practice test 4
C mcq practice test 4
 
1. Типы данных. Операции. Ввод и вывод C#
1. Типы данных. Операции. Ввод и вывод C#1. Типы данных. Операции. Ввод и вывод C#
1. Типы данных. Операции. Ввод и вывод C#
 
User defined functions in C
User defined functions in CUser defined functions in C
User defined functions in C
 
Estrutura de Dados - Aula 03 - Ponteiros e Funções
Estrutura de Dados - Aula 03 - Ponteiros e FunçõesEstrutura de Dados - Aula 03 - Ponteiros e Funções
Estrutura de Dados - Aula 03 - Ponteiros e Funções
 
Java orientação a objetos (interfaces)
Java   orientação a objetos (interfaces)Java   orientação a objetos (interfaces)
Java orientação a objetos (interfaces)
 
Storage classes in C
Storage classes in CStorage classes in C
Storage classes in C
 
Pointers in C
Pointers in CPointers in C
Pointers in C
 
Answered national council exam mixed 1-2.docx
Answered national council exam mixed 1-2.docxAnswered national council exam mixed 1-2.docx
Answered national council exam mixed 1-2.docx
 
200 mcq c++(Ankit dubey)
200 mcq c++(Ankit dubey)200 mcq c++(Ankit dubey)
200 mcq c++(Ankit dubey)
 
Constructors & destructors
Constructors & destructorsConstructors & destructors
Constructors & destructors
 
Dynamic Binding in C# 4.0
Dynamic Binding in C# 4.0Dynamic Binding in C# 4.0
Dynamic Binding in C# 4.0
 

Destaque

Instructions to candidates For DASDM
Instructions to candidates For DASDMInstructions to candidates For DASDM
Instructions to candidates For DASDM
prabhatjon
 

Destaque (10)

Oops Paper
Oops PaperOops Paper
Oops Paper
 
DVLSI Guess paper for CDAC CCAT Jun- Jul 2013 Enterence examination
DVLSI Guess paper for CDAC CCAT Jun- Jul 2013 Enterence examination DVLSI Guess paper for CDAC CCAT Jun- Jul 2013 Enterence examination
DVLSI Guess paper for CDAC CCAT Jun- Jul 2013 Enterence examination
 
CCAT Aug 2013 paper
CCAT Aug 2013 paperCCAT Aug 2013 paper
CCAT Aug 2013 paper
 
Section b a
Section b  aSection b  a
Section b a
 
Instructions to candidates For DASDM
Instructions to candidates For DASDMInstructions to candidates For DASDM
Instructions to candidates For DASDM
 
Dsda
DsdaDsda
Dsda
 
Delta final paper
Delta final paperDelta final paper
Delta final paper
 
Some question for Section C (Embeded )
Some question for Section C (Embeded )Some question for Section C (Embeded )
Some question for Section C (Embeded )
 
Some other Importent Question (Mix)
Some other Importent Question (Mix)Some other Importent Question (Mix)
Some other Importent Question (Mix)
 
Section c
Section cSection c
Section c
 

Semelhante a C and data structure

Ds lab manual by s.k.rath
Ds lab manual by s.k.rathDs lab manual by s.k.rath
Ds lab manual by s.k.rath
SANTOSH RATH
 
Getting Started Cpp
Getting Started CppGetting Started Cpp
Getting Started Cpp
Long Cao
 
Mouse programming in c
Mouse programming in cMouse programming in c
Mouse programming in c
gkgaur1987
 

Semelhante a C and data structure (20)

Lab manual data structure (cs305 rgpv) (usefulsearch.org) (useful search)
Lab manual data structure (cs305 rgpv) (usefulsearch.org)  (useful search)Lab manual data structure (cs305 rgpv) (usefulsearch.org)  (useful search)
Lab manual data structure (cs305 rgpv) (usefulsearch.org) (useful search)
 
Unit 3
Unit 3 Unit 3
Unit 3
 
CPP Homework Help
CPP Homework HelpCPP Homework Help
CPP Homework Help
 
Arrays and function basic c programming notes
Arrays and function basic c programming notesArrays and function basic c programming notes
Arrays and function basic c programming notes
 
Getting started cpp full
Getting started cpp   fullGetting started cpp   full
Getting started cpp full
 
Unit 3
Unit 3 Unit 3
Unit 3
 
Ds lab manual by s.k.rath
Ds lab manual by s.k.rathDs lab manual by s.k.rath
Ds lab manual by s.k.rath
 
Best C++ Programming Homework Help
Best C++ Programming Homework HelpBest C++ Programming Homework Help
Best C++ Programming Homework Help
 
02. Data Types and variables
02. Data Types and variables02. Data Types and variables
02. Data Types and variables
 
C programming language tutorial
C programming language tutorial C programming language tutorial
C programming language tutorial
 
Let us c (by yashvant kanetkar) chapter 1 solution
Let us c (by yashvant kanetkar) chapter 1 solutionLet us c (by yashvant kanetkar) chapter 1 solution
Let us c (by yashvant kanetkar) chapter 1 solution
 
C and Data structure lab manual ECE (2).pdf
C and Data structure lab manual ECE (2).pdfC and Data structure lab manual ECE (2).pdf
C and Data structure lab manual ECE (2).pdf
 
VCE Unit 01 (2).pptx
VCE Unit 01 (2).pptxVCE Unit 01 (2).pptx
VCE Unit 01 (2).pptx
 
linkedlist.pptx
linkedlist.pptxlinkedlist.pptx
linkedlist.pptx
 
functions
functionsfunctions
functions
 
C++_notes.pdf
C++_notes.pdfC++_notes.pdf
C++_notes.pdf
 
Microkernel Development
Microkernel DevelopmentMicrokernel Development
Microkernel Development
 
C Programming Language
C Programming LanguageC Programming Language
C Programming Language
 
Getting Started Cpp
Getting Started CppGetting Started Cpp
Getting Started Cpp
 
Mouse programming in c
Mouse programming in cMouse programming in c
Mouse programming in c
 

Mais de prabhatjon

Dasdm advanced software development methodologies
Dasdm advanced software development methodologiesDasdm advanced software development methodologies
Dasdm advanced software development methodologies
prabhatjon
 

Mais de prabhatjon (20)

Registration open for CCDAC AUG 2015 batch
Registration open for CCDAC AUG 2015 batchRegistration open for CCDAC AUG 2015 batch
Registration open for CCDAC AUG 2015 batch
 
C-CAT Exam Laptop Configuration
C-CAT Exam Laptop ConfigurationC-CAT Exam Laptop Configuration
C-CAT Exam Laptop Configuration
 
Operating system and C++ paper for CCEE
Operating system and C++ paper for CCEEOperating system and C++ paper for CCEE
Operating system and C++ paper for CCEE
 
Core java
Core javaCore java
Core java
 
Os paper
Os paperOs paper
Os paper
 
Cplus plus abd datastructure
Cplus plus abd datastructureCplus plus abd datastructure
Cplus plus abd datastructure
 
Critical Aptitude Question
Critical Aptitude QuestionCritical Aptitude Question
Critical Aptitude Question
 
Cyber law ipc
Cyber law ipcCyber law ipc
Cyber law ipc
 
Ccpp pune
Ccpp puneCcpp pune
Ccpp pune
 
Aloha paper for cdac ccpp
Aloha paper  for  cdac ccppAloha paper  for  cdac ccpp
Aloha paper for cdac ccpp
 
Diploma in Advanced Software Development Methodologies (DASDM)
Diploma in Advanced Software Development Methodologies  (DASDM)Diploma in Advanced Software Development Methodologies  (DASDM)
Diploma in Advanced Software Development Methodologies (DASDM)
 
Noida placement comp
Noida placement compNoida placement comp
Noida placement comp
 
New Address of CDAC
New Address of CDACNew Address of CDAC
New Address of CDAC
 
Course summary@bytes
Course summary@bytesCourse summary@bytes
Course summary@bytes
 
Admission booklet pg diploma courses cdac-v4
Admission booklet pg diploma courses cdac-v4Admission booklet pg diploma courses cdac-v4
Admission booklet pg diploma courses cdac-v4
 
Pg dst admissions-list
Pg dst admissions-listPg dst admissions-list
Pg dst admissions-list
 
List of companies visited Aug 2012 batch
List of companies visited Aug 2012 batchList of companies visited Aug 2012 batch
List of companies visited Aug 2012 batch
 
New added syllabus in ditiss by aug 2013 batch
New added syllabus in ditiss by aug 2013 batchNew added syllabus in ditiss by aug 2013 batch
New added syllabus in ditiss by aug 2013 batch
 
Dasdm advanced software development methodologies
Dasdm advanced software development methodologiesDasdm advanced software development methodologies
Dasdm advanced software development methodologies
 
Dasdm advertisement
Dasdm advertisement Dasdm advertisement
Dasdm advertisement
 

Último

The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
heathfieldcps1
 
Salient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functionsSalient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functions
KarakKing
 

Último (20)

The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
 
SOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning PresentationSOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning Presentation
 
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptxHMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
 
How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17
 
Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024
 
Salient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functionsSalient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functions
 
Interdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptxInterdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptx
 
REMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptxREMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptx
 
Jamworks pilot and AI at Jisc (20/03/2024)
Jamworks pilot and AI at Jisc (20/03/2024)Jamworks pilot and AI at Jisc (20/03/2024)
Jamworks pilot and AI at Jisc (20/03/2024)
 
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptxHMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdf
 
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
 
General Principles of Intellectual Property: Concepts of Intellectual Proper...
General Principles of Intellectual Property: Concepts of Intellectual  Proper...General Principles of Intellectual Property: Concepts of Intellectual  Proper...
General Principles of Intellectual Property: Concepts of Intellectual Proper...
 
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
 
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptxExploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
 
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
 
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
 
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptxCOMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
 
How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17
 
Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibit
 

C and data structure

  • 1. T: 2H 1 C and Data Structure 1. The operator & is used for 1. Bitwise AND 2. Bitwise OR 3. Logical AND 4. Logical OR 2. Built-in data structures in „C‟ are 1. Arrays 2. Structures 3. Files 4. All of the above 3 .The size of a character variable in „C‟ is 1. 4 byte 2. 8 bytes 3. 16 bytes 4. None of the above 4. What is the output of the following program segment? #include<stdio.h> main() { int i=10, m=10; clrscr(); printf(“%d”, i>m?i*i:m/m,20); getch(); } 1. 20 2. 1 3. 120 4. 100 20 5. Data type of the controlling statement of a SWITCH statement cannot of the type: 1. int 2. char 3. short 4. float 6. How long the following loop runs: for (x=0; x=3; x++) 1. Three time 2. Four times 3. Forever 4. Never 7. An expression contains assignment, relational and arithmetic operators. If parentheses are not specified, the order of evaluation of the operators would be: 1. assignment, arithmetic, relational 2. relational, arithmetic, assignment 3. assignment, relational, arithmetic 4. arithmetic, relational, assignment 8. The CONTINUE statement cannot be used with 1. for 2. switch 3. do 4. while 9. Output of the following program will be: main( ) { int a [ ] = {1, 2, 9, 8, 6, 3, 5, 7, 8, 9}; int *p = a+1; int *q = a+6; printf (“n%d”, q-p); MM:50
  • 2. 2 } 1. 9 2. 5 3. 2 4. None of the above 10. Size of the following union (assume size of int=2; size of float=4 and size of char = 1): union Jabb { int a; float b; char c; }; 1. 2 2. 4 3. 1 4. 7 11. int z, x=5, y=-10, a=4, b=2; z=x++ - --y * b / a; What will be the final value of z? 1. 5 2. 6 3. 10 4. 11 12. With every use of memory allocation function, what function should be used to release allocated memory which is no longer needed? 1. dropmem( ) 2. dealloc( ) 3. release( ) 4. free( ) 13. int warr[3][2][2] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12}; What will be the value of warr[2][1][0]? 1. 5 2. 7 3. 9 4. 11 14. char *ptr; char myString[ ] = “abcdefg”; ptr = myString; ptr += 5; The pointer ptr points to which string? 1. fg 2. efg 3. defg 4. cdefg 15. Suppose that x is initialized as: short int x; /* assume x is 16 bits in size */ What is the maximum number that can be printed using printf (“%dn”, x), 1. 127 2. 128 3. 255 4. 32,767 16. When applied to a variable, what does the unary “&” operator yield? 1. The variable‟s address 2. The variable‟s right value 3. The variable‟s binary form 4. The variable‟s value
  • 3. 3 17. How is a variable accessed from another file? 1. via the extern specifier. 2. via the auto specifier. 3. via the global specifier. 4. via the pointer specifier. 18. What does the following function print? func(int i) {if(i%2) return 0; else return 1;} main( ) { int=3; i=func(i); i=func(i); printf(“%d”, i); } 1. 3 2. 1 3. 0 4. 2 19. Given the piece of code int a[50]; int *pa; pa=a; To access the 6th element of the array which of the following is incorrect? 1. *(a+5) 2. a[5] 3. pa[5] 4. *(*pa + 5) 20. Regarding the scope of the variables; identify the incorrect statement: 1. automatic variables are automatically initialized to 0 2. static variables are automatically initialized to 0 3. the address of a register variable is not accessible 4. static variables cannot be initialized with any expression 21. Given the following code fragment: void main(voi4. { char x = „0‟; char n = „N‟; printf(“%u” ”%sn”, &n, &n); } What will be the result of execution? 1. ddddd N ( where d represents any digit) 2. 78 N 3. 78 garbage 4. compilation error 22. Given the following code fragment: int main(voi4. { int raw[20], i, sum=0; int *p = raw; for (i=0; i < 20; i++)
  • 4. 4 *(p+i) = I; for(i=0; i < 20; I += sizeof(int)) sum += *(p+i) printf(“sum = %dn”, sum); return(); } What will be the result of execution? 1. sum = 10 2. sum = 40 3. sum = 60 4. sum = 190 23. What is the missing statement in the following function which copies string x into string y void strcpy( char *x, char *y) { while (*y != „0‟) ………………… /* missing stament */ *x = „0‟; } 1. x = y 2. *x++ = *y++ 3. (*x)++ = (*y)++ 4. none of the above 24. Consider the following program, main( ) { int x = 49; for(;x;) x--; printf(“%dn”, x); } the output of the program will be 1. 49 2. 0 3. -49 4. none of the above 25. # define dp(e) printf(#e “ = %dn”,e) main( ) { int x =3, y = 2; dp(x/y) } What will be the output of the program? 1. prints x/y = 1 2. prints #e = 1. 5 3. prints #x/y = 1 4. none of the above 26 . Assume that i, j and k are integer variables and their values are 8, 5 and 0 respectively. What will be the values of variables i and k after executing the following expressions? k = ( j > 5) ? ( i < 5) ? i-j: j-i: k-j; i -= (k) ? (i) ? (j): (i): (k); 1. -3 and 3 2. 3 and -5 3. 3 and -3 4. -5 and 3
  • 5. 5 27. The && and | | operators 1. compare two numeric values 2. combine two numeric values 3. compare two boolean values 4. none of the above 28. An external variable is one 1. Which resides in the memory till the end of the program 2. Which is globally accessible by all functions 3. Which is declared outside the body of any function 4. All of the above 29. Find the error in the following program: main( ) { int m; char g; switch(m) { case 5 : grade=”P”;break; case 2 : grade=”Q”;break; case 2 : grade=”R”;break; default : grade=”S”;break; } } 1. No two labels may be identical 2. switch statement cannot have more than three labels 3. case label cannot be numbers 4. none of the above 30. Consider the following program: main( ) { char *k=”xyz; f(k); printf(“%sn”,k); } f(char *k) { k = malloc(4); strcpy(k, “pq”); } What will be the output? 1. pq 2. xyz 3. syntax error 4. none of the above 31. Time complexity of insertion sort algorithm in the best case is 1. O(n) 2. O(n log2 n) 3. O(n2 ) 4. none of the above 32. In linked list representation, a node contains at least 1. node address field, data field 2. node number, data field 3. next address field, information field 4. none of the above
  • 6. 6 33. Which of the following statements are true: 1. binary search is always better than sequential search. 2. binary search is better than sequential search when number of elements is small. 3. binary search is better than sequential search when number of elements is very large. 4. binary search is always inferior to sequential search. 34 In an 16-bit computer, 30 digit integer can be stored in 1. an integer variable 2. floating point variable 3. a circular list 4. none of the above 35 A stack can be used to 1. allocate resources by the operating system 2. to schedule jobs on round-robin basis 3. process procedure call in a program 4. none of the above 36. An ordered set of items from which items may be deleted at either end and into which items may be inserted at either end is called. 1. Queue 2. Stack 3. Heap 4. Dequeue 37. The property of hash function is that 1. it minimizes the rate of overflow 2. it preserves the order of key values. 3. it minimizes number of collisions. 4. none of the above. 38. The number of comparisons needed to merge-sort a list of n elements is 1. O(n log n) 2. O(n log log n) 3. O(n) 4. O(n log n2 ) 39. In the text of the divide and conquer algorithm must contain at least 1. One recursive call 2. Two recursive calls 3. Either one or zero calls 4. None of the above 40. In a stack, top=0 denotes that 1. stack is empty 2. stack is full 3. top has no element 4. none of the above 41. The correct increasing order of magnitude of computing time is- 1. O(1) < O(logn) < O(n) < O(n logn) < O(n2 ) < O(n3 ) < O(2n ) 2. O(2n ) < O(n3 ) < O(n2 ) < O(n logn) < O(n) < O(logn) O(1) 3. O(logn) < O(n logn) < O(n) < O(n2 ) < O(n3 ) < O(2n ) < O(1) 4. None of the above 42. Suppose the union is declared like union { float x;
  • 7. 7 char c[10]; int y; }num; Assuming that float requires 4 bytes, char requires 1 byte and int requires 2 bytes, the memory space used by the variable num is 1. 16 bytes 2. 10 bytes 3. 4 bytes 4. 7 bytes 43. Which data structure is implemented in automatic variable declaration? 1. Queue 2. Stack 3. Heap 4. Graph 44. If j=2, m=1, x=3, y=4. What is the value of the expression j++ = = m = = y * x 1. 0 2. 1 3. 2 4. 3 45. Which of the following data structure may give overflow error, even though the current number of elements in it, is less than its size 1. simple queue 2. circular queue 3. stack 4. none of the above 46. Which one is not correct? 1. Pointers are used for dynamically allocating memory. 2. Dynamic memory allocation is preferred when storage requirement is not predictable. 3. Data access in dynamically allocated storage is faster than static allocated storage. 4. None of the above 47. Which of the following cannot be performed recursively? 1. Binary Search 2. Quick Sort 3. Depth First Search 4. None of the above 48. “p” is a pointer to the structure. A member “mem” of that structure is referenced by 1. *p.mem 2. (*p).mem 3. *(p.mem) 4. None of the above 49. If the file contains data (61, 41, 91, 11) then the most suitable sorting technique is– 1. Quick sort 2. Radix sort 3. Insertion sort 4. None of the above 50. If there are total n nodes, then memory compaction requires 1 . O (log2 n) steps 2. O (n) steps 3. O (n2 ) steps 4. None of the above