SlideShare une entreprise Scribd logo
1  sur  7
Télécharger pour lire hors ligne
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

Contenu connexe

Tendances (20)

Oop c++class(final).ppt
Oop c++class(final).pptOop c++class(final).ppt
Oop c++class(final).ppt
 
Inheritance OOP Concept in C++.
Inheritance OOP Concept in C++.Inheritance OOP Concept in C++.
Inheritance OOP Concept in C++.
 
Inheritance
InheritanceInheritance
Inheritance
 
Tokens expressionsin C++
Tokens expressionsin C++Tokens expressionsin C++
Tokens expressionsin C++
 
Computer graphics
Computer graphics   Computer graphics
Computer graphics
 
Inheritance
InheritanceInheritance
Inheritance
 
Exception Handling in C++
Exception Handling in C++Exception Handling in C++
Exception Handling in C++
 
Hierarchical inheritance
Hierarchical inheritanceHierarchical inheritance
Hierarchical inheritance
 
Chapter 8 c solution
Chapter 8 c solutionChapter 8 c solution
Chapter 8 c solution
 
Polymorphism in java
Polymorphism in javaPolymorphism in java
Polymorphism in java
 
C# Overriding
C# OverridingC# Overriding
C# Overriding
 
LET US C (5th EDITION) CHAPTER 2 ANSWERS
LET US C (5th EDITION) CHAPTER 2 ANSWERSLET US C (5th EDITION) CHAPTER 2 ANSWERS
LET US C (5th EDITION) CHAPTER 2 ANSWERS
 
DAC CCAT GUESS PAPER Jun-Jul 2013
DAC CCAT GUESS PAPER Jun-Jul 2013 DAC CCAT GUESS PAPER Jun-Jul 2013
DAC CCAT GUESS PAPER Jun-Jul 2013
 
Super and final in java
Super and final in javaSuper and final in java
Super and final in java
 
Functions in c language
Functions in c language Functions in c language
Functions in c language
 
C++ classes tutorials
C++ classes tutorialsC++ classes tutorials
C++ classes tutorials
 
Java packages
Java packagesJava packages
Java packages
 
Chap 11(pointers)
Chap 11(pointers)Chap 11(pointers)
Chap 11(pointers)
 
Learn C Programming Language by Using GDB
Learn C Programming Language by Using GDBLearn C Programming Language by Using GDB
Learn C Programming Language by Using GDB
 
Operator overloading and type conversions
Operator overloading and type conversionsOperator overloading and type conversions
Operator overloading and type conversions
 

En vedette

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 prabhatjon
 
CCAT Aug 2013 paper
CCAT Aug 2013 paperCCAT Aug 2013 paper
CCAT Aug 2013 paperprabhatjon
 
Instructions to candidates For DASDM
Instructions to candidates For DASDMInstructions to candidates For DASDM
Instructions to candidates For DASDMprabhatjon
 
Delta final paper
Delta final paperDelta final paper
Delta final paperprabhatjon
 
Some question for Section C (Embeded )
Some question for Section C (Embeded )Some question for Section C (Embeded )
Some question for Section C (Embeded )prabhatjon
 
Some other Importent Question (Mix)
Some other Importent Question (Mix)Some other Importent Question (Mix)
Some other Importent Question (Mix)prabhatjon
 
GUESS FUNDAMENTAL PAPER FOE CCAT Feb 2014
GUESS FUNDAMENTAL PAPER FOE CCAT Feb 2014GUESS FUNDAMENTAL PAPER FOE CCAT Feb 2014
GUESS FUNDAMENTAL PAPER FOE CCAT Feb 2014prabhatjon
 

En vedette (11)

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)
 
GUESS FUNDAMENTAL PAPER FOE CCAT Feb 2014
GUESS FUNDAMENTAL PAPER FOE CCAT Feb 2014GUESS FUNDAMENTAL PAPER FOE CCAT Feb 2014
GUESS FUNDAMENTAL PAPER FOE CCAT Feb 2014
 
Section c
Section cSection c
Section c
 

Similaire à C and data structure

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)Make Mannan
 
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 notesGOKULKANNANMMECLECTC
 
Getting started cpp full
Getting started cpp   fullGetting started cpp   full
Getting started cpp fullVõ Hòa
 
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.rathSANTOSH RATH
 
Best C++ Programming Homework Help
Best C++ Programming Homework HelpBest C++ Programming Homework Help
Best C++ Programming Homework HelpC++ Homework Help
 
02. Data Types and variables
02. Data Types and variables02. Data Types and variables
02. Data Types and variablesIntro C# Book
 
C programming language tutorial
C programming language tutorial C programming language tutorial
C programming language tutorial javaTpoint s
 
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 solutionHazrat Bilal
 
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).pdfjanakim15
 
VCE Unit 01 (2).pptx
VCE Unit 01 (2).pptxVCE Unit 01 (2).pptx
VCE Unit 01 (2).pptxskilljiolms
 
C Programming Language
C Programming LanguageC Programming Language
C Programming LanguageRTS Tech
 
Getting Started Cpp
Getting Started CppGetting Started Cpp
Getting Started CppLong Cao
 
Mouse programming in c
Mouse programming in cMouse programming in c
Mouse programming in cgkgaur1987
 

Similaire à 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
 

Plus de prabhatjon

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 batchprabhatjon
 
C-CAT Exam Laptop Configuration
C-CAT Exam Laptop ConfigurationC-CAT Exam Laptop Configuration
C-CAT Exam Laptop Configurationprabhatjon
 
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 CCEEprabhatjon
 
Cplus plus abd datastructure
Cplus plus abd datastructureCplus plus abd datastructure
Cplus plus abd datastructureprabhatjon
 
Critical Aptitude Question
Critical Aptitude QuestionCritical Aptitude Question
Critical Aptitude Questionprabhatjon
 
Aloha paper for cdac ccpp
Aloha paper  for  cdac ccppAloha paper  for  cdac ccpp
Aloha paper for cdac ccppprabhatjon
 
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)prabhatjon
 
Noida placement comp
Noida placement compNoida placement comp
Noida placement compprabhatjon
 
New Address of CDAC
New Address of CDACNew Address of CDAC
New Address of CDACprabhatjon
 
Course summary@bytes
Course summary@bytesCourse summary@bytes
Course summary@bytesprabhatjon
 
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-v4prabhatjon
 
Pg dst admissions-list
Pg dst admissions-listPg dst admissions-list
Pg dst admissions-listprabhatjon
 
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 batchprabhatjon
 
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 batchprabhatjon
 
Dasdm advanced software development methodologies
Dasdm advanced software development methodologiesDasdm advanced software development methodologies
Dasdm advanced software development methodologiesprabhatjon
 
Dasdm advertisement
Dasdm advertisement Dasdm advertisement
Dasdm advertisement prabhatjon
 

Plus 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
 

Dernier

Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationnomboosow
 
APM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAPM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAssociation for Project Management
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxiammrhaywood
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdfQucHHunhnh
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphThiyagu K
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityGeoBlogs
 
Student login on Anyboli platform.helpin
Student login on Anyboli platform.helpinStudent login on Anyboli platform.helpin
Student login on Anyboli platform.helpinRaunakKeshri1
 
social pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajansocial pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajanpragatimahajan3
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfAdmir Softic
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introductionMaksud Ahmed
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformChameera Dedduwage
 
fourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writingfourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writingTeacherCyreneCayanan
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Sapana Sha
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdfQucHHunhnh
 
General AI for Medical Educators April 2024
General AI for Medical Educators April 2024General AI for Medical Educators April 2024
General AI for Medical Educators April 2024Janet Corral
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeThiyagu K
 
Disha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdfDisha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdfchloefrazer622
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingTechSoup
 

Dernier (20)

Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communication
 
APM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAPM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across Sectors
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
 
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot Graph
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activity
 
Student login on Anyboli platform.helpin
Student login on Anyboli platform.helpinStudent login on Anyboli platform.helpin
Student login on Anyboli platform.helpin
 
social pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajansocial pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajan
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdf
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy Reform
 
fourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writingfourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writing
 
Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
 
General AI for Medical Educators April 2024
General AI for Medical Educators April 2024General AI for Medical Educators April 2024
General AI for Medical Educators April 2024
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and Mode
 
Disha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdfDisha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdf
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy Consulting
 

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