SlideShare a Scribd company logo
1 of 19
Download to read offline
1
Which of the following is not true in
case of C structure ? a)
A structure is a collection
of elements that can be of
same data type.
b)
A structure is a collection
of elements that can be of
different data type.
c) Elements of a structure are
called members. d) Structure elements
share the memory space
2
Structure: Sum of the sizes of all
members, Union: a) First member in the union b) Last member in the union c) Biggest member in the union d) Sum of the sizes of all
members
3
Size of a union is determined by size
of the ____________ a) First member in the union b) Last member in the union c) Biggest member in the union d) Sum of the sizes of all
members
4 What is the size of C Structure ? a) C structure is always 128
bytes. b)
Size of C structure is the
total bytes of all elements
of structure
c) Size of C structure is the
size of largest element. d) First member in the
structure
5
Which of the following is not true in
case of C structure ? a) we can make array of
structure b) we can write structure
content into file c) we can have many variables
of type structure d)
we can have only one
variable of type
structure
6
Which predefined function is used to
write data from structure into a file a) write() b) swrite() c) fwrite() d) gets()
7
Which of the following structure
declaration will result into an error? a) struct temp{}s; main(){} b) struct temp{}; struct temp s;
main(){} c) struct temp s; struct temp{};
main(){} d) struct temp{}s[10];
main(){}
8
Structure: The statement s[5].name
indicates -------- a) name of roll no 5 b) name of roll no 4 c) roll number 5 d) roll number 6
9
Which of the following is incorrect
structure variable declaration ? a)
struct stud s;
b)
struct stud s1,s2;
c)
struct stud s[5];
d)
struct stud s{};
10
The correct syntax to access the
ith member of the array of structure
struct temp
{
int b;
}s[50];
a) s.b.[i]; b) s.[i].b; c) s.b[i]; d) s[i].b;
11 A pointer is_________. a) A keyword used to create
variables b) A variable that stores
address of an instruction c) A variable that stores
address of other variable d) All the mentioned
12
The operator used to get value at
address stored in a pointer variable
is________.
a) * b) & c) && d) | |
13
Comment on the following?
const int *ptr; a) You cannot change the
value pointed by ptr b) You cannot change the
pointer ptr itself c) Both Choice1 and Choice 2 d)
You can change the
pointer as well as the
value pointed by it
14
Which of the following does not
initialize ptr to null (assuming variable
declaration of a as int a=0)?
a) All of the mentioned b) int *ptr = a – a; c) int *ptr = &a – &a; d) int *ptr = &a;
15
Which of the following is correct
syntax to send an array as a
parameter to function:
a) func(&array); b) func(*array); c) func(array); d) func(array[size]);
16
In C a pointer variable to an integer
can be created by the decalaration a) int p*; b) int +p; c) int $p; d) int *p;
17 A pointer variable can be______. a) Passed to a function b) Changed within a function c) Returned by a function d) Can be assigned an
integer value
18
The declaration
int (*p) [5];
means
a)
p is a one dimensional array
of size 5, of pointers to
integers
b) the same as int *p[5]; c) p is a pointer to a 5 element
integer array d) none of the mentioned
19
What do the following declaration
signify?
char *arr[10];
a) arr is a array of 10
character pointers. b) arr is a array of function
pointer. c) arr is a array of characters. d) arr is a pointer to array
of characters.
20
What will be the output of the
program ?
#include<stdio.h>
int main()
{
int i=3, *j, k;
j = &i;
printf("%dn", i**j*i+*j);
return 0;
}
a) 27 b) 30 c) 9 d) 3
21
What will be the output of the
program ?
#include<stdio.h>
int main()
{
char *str;
str = "%s";
printf(str, "Kn");
return 0;
}
a) Error b) No Output c) K d) %s
22
What will be the output of the
program?
#include<stdio.h>
int main()
{
int arr[2][2][2] = {10, 2, 3, 4, 5, 6, 7
8};
int *p, *q;
p = &arr[1][1][1];
q = (int*) arr;
printf("%d, %dn", *p, *q);
return 0;
}
a) 10, 2 b) 8, 10 c) 8, 1 d) Garbage values
23
What is the output of this C code?
void main()
{
int i = 0;
int j = 0;
for (i = 0;i < 5; i++)
{
for (j = 0;j < 4; j++)
{
if (i > 1)
continue;
printf("Hi n");
}
}
}
a) Hi is printed 9 times b) Hi is printed 8 times c) Hi is printed 7 times d) Hi is printed 6 times
24
What is the output of this C code?
int main()
{
int i = 0;
do
{
i++;
if (i == 2)
continue;
printf("In while loop ");
} while (i < 2);
printf("%dn", i);
}
a) In while loop 2 b) In while loop In while loop 3 c) In while loop 3 d) Infinite loop
25
What is the output of this C code?
int main()
{
int i = 0;
char c = 'a';
while (i < 2){
i++;
switch (c) {
case 'a':
printf("%c ", c);
break;
break;
}
}
printf("after loopn");
}
a) a after loop b) a a after loop c) after loop d) None of the mentioned
26
What is the output of this C code?
int main()
{
int i = 0;
for (i++; i == 1; i = 2)
printf("In for loop ");
printf("After loopn");
}
a) In for loop after loop b) After loop c) Compile time error d) Undefined behavior
27
What is the output of this C code?
int main()
{
int i = 0;
for (foo(); i == 1; i = 2)
printf("In for loopn");
printf("After loopn");
}
int foo()
{
return 1;
}
a) After loop b) In for loop after loop c) Compile time error d) Infinite loop
28
What is the output of the code
given below?
int main()
{
printf("%d ", 1);
goto l1;
printf("%d ", 2);
l1:goto l2;
printf("%d ", 3);
l2:printf("%d ", 4);
}
a) 1 4 b) 1 c) 1 2 4 d) 1 3 4
29
What is output of code given below?
int main()
{
int i = 0, j = 0;
while (i < 2)
{
l1 : i++;
while (j < 3)
{
printf("Loopn");
goto l1;
}
}
}
a) Loop Loop b) Compilation error c) Loop Loop Loop Loop d) Infinite Loop
30
What is output of code given below?
int main()
{
int i = 0, j = 0;
while (i < 2)
{
l1 : i++;
while (j < 3)
{
printf("Loopn");
goto l1;
}
}
}
a) loop loop b) Compilation error c) loop loop loop loop d) Infinite Loop
31
What is the output of the code
given below?
int main()
{
int i = 0, j = 0;
l1: while (i < 2)
{
i++;
while (j < 3)
{
printf("loopn");
goto l1;
}
}
}
a) loop loop b) compilation error c) loop loop loop loop d) infinite loop
32
The output of the code below is?
void main()
{
int i = 0;
if (i == 0)
{
goto label;
}
label: printf("Hello");
}
a) Nothing b) Error c) Infinite Hello d) Hello
33
In the following loop construct, which
one is executed only once always.
for(exp1; exp2; exp3)
a) exp1 b) exp3 c) exp1 and exp3 d)
exp1, exp2 and
exp3
34
Which keyword can be used for
coming out of recursion?
a) break b) return c) exit d) Both (a) and (b)
35
What is the output of this C code
int main()
{
int a = 0, i = 0, b;
for (i = 0;i < 5; i++)
{
a++;
continue;
}
}
a) 2 b) 3 c) 5 d) 4
36
What is the output of this C code
int main()
{
int a = 0, i = 0, b;
for (i = 0;i < 5; i++)
{
a++;
if (i == 3)
break;
}
}
a) 1 b) 2 c) 3 d) 4
37
What is the output of this C code
void main()
{
int i = 0;
for (i = 0;i < 5; i++)
if (i < 4)
{
printf("Hello");
break;
}
}
a) Hello is printed 5 times b) Hello is printed 4 times c) Hello d) Hello is printed 3 times
38
What is the output of this C code?
#include <stdio.h>
struct student
{
int roll;
char name[10];
};
void main()
{
struct student s;
printf("%d", sizeof(s));
}
a) 10 b) 2 c) 12 d) 8
39
What is the output of this C code?
#include <stdio.h>
union student
{
int roll;
char name[10];
};
void main()
{
union student s;
printf("%d", sizeof(s));
}
a) 10 b) 20 c) 12 d) 8
40
Comment on the output of this C
code?
#include <stdio.h>
struct temp
{
int a;
int b;
int c;
};
main()
{
struct temp p[] = {{1, 2, 3}, {4, 5, 6},
{7, 8, 9}} }
a) generates an array of
structure of size 3 b) generates an array of
structure of size 9 c) illegal declaration of a
multidimensional array d) illegal assignment to
members of structure
41
What is the output of C program with
structures.?
int main()
{
struct tree
{
int h;
}
struct tree tree1;
tree1.h=10;
printf("Height=%d",tree1.h);
return 0;
}
a) Height=0 b) Height=10 c) Height= d) Height=2
42
How much memory space will be
allocated in the following C code?
#include <stdio.h>
union emp
{
int id;
float salary;
char ename[10];
} e;
a)
Will be large enough to hold
the largest of the three
types;
b)
Will be large enough to
hold the smallest of the
three types;
c) Will be large enough to hold
the all of the three types; d) will be as per the
requirement
43
What is the output of C program.?
int main()
{
struct book
{
int pages;
char name[10];
}a;
a.pages=500;
strcpy(a.name,"Let us C");
printf("%s=%d", a.name,a.pages);
return 0;
}
a) Let us C=100 b) 100=Let us C c) Let us C
101 d) 100
Let us C
44
What is the output of this C code?
#include <stdio.h>
struct p
{
int k;
char c;
};
int p = 10;
int main()
{
struct p x;
x.k = 10;
printf("%d %dn", x.k, p);
}
a) error b) garbage value c) 10 d) 10,10
45 Comment on the following C statement
int (*a)[7];
a)
An array “a” of pointers
b)
A pointer “a” to an array
c) A simple array of size 7 d) None of the
mentioned
46 A function can be invoked from
another function using its ___
a) Value b) Return c) Name d) Variables
47 If the two strings are identical, then
strcmp() function returns
a) -1 b) 1 c) 0 d) None
48
What will be the output of the
program ?#include<stdio.h>
#include<string.h>
int main()
{
char str1[20] = "Hello", str2[20] = "
World";
printf("%sn", strcpy(str2, strcat(str1,
str2)));
return 0;
}
a) Hello b) Hello c) Hello World d) WorldHello
49
What will be the output of the
program?#include<stdio.h>
int i;
int fun();
int main()
{
while(i)
{
fun();
main();
}
printf("Hellon");
return 0;
}
int fun()
{
printf("Hi");
}
a)
Hello
b)
Hi Hello
c)
No output
d)
Infinite loop
50
What will be the output of the
program ?#include<stdio.h>
#include<string.h>
int main()
{
static char str1[] = "dills";
static char str2[20];
static char str3[] = "Daffo";
int i;
i = strcmp(strcat(str3, strcpy(str2,
str1)), "Daffodills");
printf("%dn", i);
return 0;
}
a) 0 b) 1 c) 2 d) 4
1 4
2 3
3 3
4 2
5 4
6 3
7 3
8 2
9 4
10 4
11 3
12 1
13 1
14 4
15 3
16 4
17 3
18 3
19 1
20 2
21 3
22 2
23 2
24 1
25 2
26 1
27 1
28 1
29 4
30 4
31 1
32 4
33 1
34 2
35 3
36 4
37 3
38 3
39 1
40 1
41 2
42 1
43 1
44 4
45 A pointer “a”
to an array
46 Name
47 0
48
Hello World
49 Hello
50 0

More Related Content

Similar to LDCQ paper Dec21 with answer key_62cb2996afc60f6aedeb248c1d9283e5.pdf

(Www.entrance exam.net)-tcs placement sample paper 2
(Www.entrance exam.net)-tcs placement sample paper 2(Www.entrance exam.net)-tcs placement sample paper 2
(Www.entrance exam.net)-tcs placement sample paper 2Pamidimukkala Sivani
 
this pdf very much useful for embedded c programming students
this pdf very much useful for embedded c programming studentsthis pdf very much useful for embedded c programming students
this pdf very much useful for embedded c programming studentspavan81088
 
MATLAB Questions and Answers.pdf
MATLAB Questions and Answers.pdfMATLAB Questions and Answers.pdf
MATLAB Questions and Answers.pdfahmed8651
 
Java Questioner for
Java Questioner for Java Questioner for
Java Questioner for Abhay Korat
 
C aptitude 1st jan 2012
C aptitude 1st jan 2012C aptitude 1st jan 2012
C aptitude 1st jan 2012Kishor Parkhe
 
C multiple choice questions and answers pdf
C multiple choice questions and answers pdfC multiple choice questions and answers pdf
C multiple choice questions and answers pdfchoconyeuquy
 
ExamName___________________________________MULTIPLE CH.docx
ExamName___________________________________MULTIPLE CH.docxExamName___________________________________MULTIPLE CH.docx
ExamName___________________________________MULTIPLE CH.docxgitagrimston
 
15CS664- Python Application Programming- Question bank 1
15CS664- Python Application Programming- Question bank 115CS664- Python Application Programming- Question bank 1
15CS664- Python Application Programming- Question bank 1Syed Mustafa
 
Sample Paper 2 Class XI (Computer Science)
Sample Paper 2 Class XI (Computer Science)Sample Paper 2 Class XI (Computer Science)
Sample Paper 2 Class XI (Computer Science)Poonam Chopra
 
Technical aptitude test 2 CSE
Technical aptitude test 2 CSETechnical aptitude test 2 CSE
Technical aptitude test 2 CSESujata Regoti
 

Similar to LDCQ paper Dec21 with answer key_62cb2996afc60f6aedeb248c1d9283e5.pdf (20)

(Www.entrance exam.net)-tcs placement sample paper 2
(Www.entrance exam.net)-tcs placement sample paper 2(Www.entrance exam.net)-tcs placement sample paper 2
(Www.entrance exam.net)-tcs placement sample paper 2
 
Technical questions
Technical questionsTechnical questions
Technical questions
 
this pdf very much useful for embedded c programming students
this pdf very much useful for embedded c programming studentsthis pdf very much useful for embedded c programming students
this pdf very much useful for embedded c programming students
 
MATLAB Questions and Answers.pdf
MATLAB Questions and Answers.pdfMATLAB Questions and Answers.pdf
MATLAB Questions and Answers.pdf
 
Java Questioner for
Java Questioner for Java Questioner for
Java Questioner for
 
Introduction to c part 2
Introduction to c   part  2Introduction to c   part  2
Introduction to c part 2
 
C aptitude 1st jan 2012
C aptitude 1st jan 2012C aptitude 1st jan 2012
C aptitude 1st jan 2012
 
C Programming
C ProgrammingC Programming
C Programming
 
Part - 2 Cpp programming Solved MCQ
Part - 2  Cpp programming Solved MCQ Part - 2  Cpp programming Solved MCQ
Part - 2 Cpp programming Solved MCQ
 
C multiple choice questions and answers pdf
C multiple choice questions and answers pdfC multiple choice questions and answers pdf
C multiple choice questions and answers pdf
 
C question bank
C question bankC question bank
C question bank
 
Quiz 9
Quiz 9Quiz 9
Quiz 9
 
C language
C languageC language
C language
 
ExamName___________________________________MULTIPLE CH.docx
ExamName___________________________________MULTIPLE CH.docxExamName___________________________________MULTIPLE CH.docx
ExamName___________________________________MULTIPLE CH.docx
 
C exam
C examC exam
C exam
 
C test
C testC test
C test
 
15CS664- Python Application Programming- Question bank 1
15CS664- Python Application Programming- Question bank 115CS664- Python Application Programming- Question bank 1
15CS664- Python Application Programming- Question bank 1
 
Sample Paper 2 Class XI (Computer Science)
Sample Paper 2 Class XI (Computer Science)Sample Paper 2 Class XI (Computer Science)
Sample Paper 2 Class XI (Computer Science)
 
Technical aptitude test 2 CSE
Technical aptitude test 2 CSETechnical aptitude test 2 CSE
Technical aptitude test 2 CSE
 
FSOFT - Test Java Exam
FSOFT - Test Java ExamFSOFT - Test Java Exam
FSOFT - Test Java Exam
 

Recently uploaded

Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort serviceGurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort servicejennyeacort
 
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSAPPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSKurinjimalarL3
 
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdfCCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdfAsst.prof M.Gokilavani
 
Introduction to Microprocesso programming and interfacing.pptx
Introduction to Microprocesso programming and interfacing.pptxIntroduction to Microprocesso programming and interfacing.pptx
Introduction to Microprocesso programming and interfacing.pptxvipinkmenon1
 
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVHARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVRajaP95
 
main PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfidmain PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfidNikhilNagaraju
 
GDSC ASEB Gen AI study jams presentation
GDSC ASEB Gen AI study jams presentationGDSC ASEB Gen AI study jams presentation
GDSC ASEB Gen AI study jams presentationGDSCAESB
 
Microscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptxMicroscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptxpurnimasatapathy1234
 
Internship report on mechanical engineering
Internship report on mechanical engineeringInternship report on mechanical engineering
Internship report on mechanical engineeringmalavadedarshan25
 
Call Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile serviceCall Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile servicerehmti665
 
Application of Residue Theorem to evaluate real integrations.pptx
Application of Residue Theorem to evaluate real integrations.pptxApplication of Residue Theorem to evaluate real integrations.pptx
Application of Residue Theorem to evaluate real integrations.pptx959SahilShah
 
Current Transformer Drawing and GTP for MSETCL
Current Transformer Drawing and GTP for MSETCLCurrent Transformer Drawing and GTP for MSETCL
Current Transformer Drawing and GTP for MSETCLDeelipZope
 
Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...
Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...
Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...srsj9000
 
HARMONY IN THE HUMAN BEING - Unit-II UHV-2
HARMONY IN THE HUMAN BEING - Unit-II UHV-2HARMONY IN THE HUMAN BEING - Unit-II UHV-2
HARMONY IN THE HUMAN BEING - Unit-II UHV-2RajaP95
 
Concrete Mix Design - IS 10262-2019 - .pptx
Concrete Mix Design - IS 10262-2019 - .pptxConcrete Mix Design - IS 10262-2019 - .pptx
Concrete Mix Design - IS 10262-2019 - .pptxKartikeyaDwivedi3
 
Introduction-To-Agricultural-Surveillance-Rover.pptx
Introduction-To-Agricultural-Surveillance-Rover.pptxIntroduction-To-Agricultural-Surveillance-Rover.pptx
Introduction-To-Agricultural-Surveillance-Rover.pptxk795866
 
VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...
VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...
VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...VICTOR MAESTRE RAMIREZ
 
IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024Mark Billinghurst
 

Recently uploaded (20)

POWER SYSTEMS-1 Complete notes examples
POWER SYSTEMS-1 Complete notes  examplesPOWER SYSTEMS-1 Complete notes  examples
POWER SYSTEMS-1 Complete notes examples
 
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort serviceGurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
 
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSAPPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
 
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdfCCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
 
Introduction to Microprocesso programming and interfacing.pptx
Introduction to Microprocesso programming and interfacing.pptxIntroduction to Microprocesso programming and interfacing.pptx
Introduction to Microprocesso programming and interfacing.pptx
 
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVHARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
 
main PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfidmain PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfid
 
GDSC ASEB Gen AI study jams presentation
GDSC ASEB Gen AI study jams presentationGDSC ASEB Gen AI study jams presentation
GDSC ASEB Gen AI study jams presentation
 
Microscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptxMicroscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptx
 
Internship report on mechanical engineering
Internship report on mechanical engineeringInternship report on mechanical engineering
Internship report on mechanical engineering
 
Call Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile serviceCall Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile service
 
Application of Residue Theorem to evaluate real integrations.pptx
Application of Residue Theorem to evaluate real integrations.pptxApplication of Residue Theorem to evaluate real integrations.pptx
Application of Residue Theorem to evaluate real integrations.pptx
 
Current Transformer Drawing and GTP for MSETCL
Current Transformer Drawing and GTP for MSETCLCurrent Transformer Drawing and GTP for MSETCL
Current Transformer Drawing and GTP for MSETCL
 
Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...
Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...
Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...
 
HARMONY IN THE HUMAN BEING - Unit-II UHV-2
HARMONY IN THE HUMAN BEING - Unit-II UHV-2HARMONY IN THE HUMAN BEING - Unit-II UHV-2
HARMONY IN THE HUMAN BEING - Unit-II UHV-2
 
Concrete Mix Design - IS 10262-2019 - .pptx
Concrete Mix Design - IS 10262-2019 - .pptxConcrete Mix Design - IS 10262-2019 - .pptx
Concrete Mix Design - IS 10262-2019 - .pptx
 
Introduction-To-Agricultural-Surveillance-Rover.pptx
Introduction-To-Agricultural-Surveillance-Rover.pptxIntroduction-To-Agricultural-Surveillance-Rover.pptx
Introduction-To-Agricultural-Surveillance-Rover.pptx
 
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCRCall Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
 
VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...
VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...
VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...
 
IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024
 

LDCQ paper Dec21 with answer key_62cb2996afc60f6aedeb248c1d9283e5.pdf

  • 1. 1 Which of the following is not true in case of C structure ? a) A structure is a collection of elements that can be of same data type. b) A structure is a collection of elements that can be of different data type. c) Elements of a structure are called members. d) Structure elements share the memory space 2 Structure: Sum of the sizes of all members, Union: a) First member in the union b) Last member in the union c) Biggest member in the union d) Sum of the sizes of all members 3 Size of a union is determined by size of the ____________ a) First member in the union b) Last member in the union c) Biggest member in the union d) Sum of the sizes of all members 4 What is the size of C Structure ? a) C structure is always 128 bytes. b) Size of C structure is the total bytes of all elements of structure c) Size of C structure is the size of largest element. d) First member in the structure 5 Which of the following is not true in case of C structure ? a) we can make array of structure b) we can write structure content into file c) we can have many variables of type structure d) we can have only one variable of type structure 6 Which predefined function is used to write data from structure into a file a) write() b) swrite() c) fwrite() d) gets() 7 Which of the following structure declaration will result into an error? a) struct temp{}s; main(){} b) struct temp{}; struct temp s; main(){} c) struct temp s; struct temp{}; main(){} d) struct temp{}s[10]; main(){} 8 Structure: The statement s[5].name indicates -------- a) name of roll no 5 b) name of roll no 4 c) roll number 5 d) roll number 6 9 Which of the following is incorrect structure variable declaration ? a) struct stud s; b) struct stud s1,s2; c) struct stud s[5]; d) struct stud s{}; 10 The correct syntax to access the ith member of the array of structure struct temp { int b; }s[50]; a) s.b.[i]; b) s.[i].b; c) s.b[i]; d) s[i].b; 11 A pointer is_________. a) A keyword used to create variables b) A variable that stores address of an instruction c) A variable that stores address of other variable d) All the mentioned 12 The operator used to get value at address stored in a pointer variable is________. a) * b) & c) && d) | | 13 Comment on the following? const int *ptr; a) You cannot change the value pointed by ptr b) You cannot change the pointer ptr itself c) Both Choice1 and Choice 2 d) You can change the pointer as well as the value pointed by it 14 Which of the following does not initialize ptr to null (assuming variable declaration of a as int a=0)? a) All of the mentioned b) int *ptr = a – a; c) int *ptr = &a – &a; d) int *ptr = &a; 15 Which of the following is correct syntax to send an array as a parameter to function: a) func(&array); b) func(*array); c) func(array); d) func(array[size]); 16 In C a pointer variable to an integer can be created by the decalaration a) int p*; b) int +p; c) int $p; d) int *p; 17 A pointer variable can be______. a) Passed to a function b) Changed within a function c) Returned by a function d) Can be assigned an integer value
  • 2. 18 The declaration int (*p) [5]; means a) p is a one dimensional array of size 5, of pointers to integers b) the same as int *p[5]; c) p is a pointer to a 5 element integer array d) none of the mentioned 19 What do the following declaration signify? char *arr[10]; a) arr is a array of 10 character pointers. b) arr is a array of function pointer. c) arr is a array of characters. d) arr is a pointer to array of characters. 20 What will be the output of the program ? #include<stdio.h> int main() { int i=3, *j, k; j = &i; printf("%dn", i**j*i+*j); return 0; } a) 27 b) 30 c) 9 d) 3 21 What will be the output of the program ? #include<stdio.h> int main() { char *str; str = "%s"; printf(str, "Kn"); return 0; } a) Error b) No Output c) K d) %s 22 What will be the output of the program? #include<stdio.h> int main() { int arr[2][2][2] = {10, 2, 3, 4, 5, 6, 7 8}; int *p, *q; p = &arr[1][1][1]; q = (int*) arr; printf("%d, %dn", *p, *q); return 0; } a) 10, 2 b) 8, 10 c) 8, 1 d) Garbage values
  • 3. 23 What is the output of this C code? void main() { int i = 0; int j = 0; for (i = 0;i < 5; i++) { for (j = 0;j < 4; j++) { if (i > 1) continue; printf("Hi n"); } } } a) Hi is printed 9 times b) Hi is printed 8 times c) Hi is printed 7 times d) Hi is printed 6 times 24 What is the output of this C code? int main() { int i = 0; do { i++; if (i == 2) continue; printf("In while loop "); } while (i < 2); printf("%dn", i); } a) In while loop 2 b) In while loop In while loop 3 c) In while loop 3 d) Infinite loop 25 What is the output of this C code? int main() { int i = 0; char c = 'a'; while (i < 2){ i++; switch (c) { case 'a': printf("%c ", c); break; break; } } printf("after loopn"); } a) a after loop b) a a after loop c) after loop d) None of the mentioned 26 What is the output of this C code? int main() { int i = 0; for (i++; i == 1; i = 2) printf("In for loop "); printf("After loopn"); } a) In for loop after loop b) After loop c) Compile time error d) Undefined behavior
  • 4. 27 What is the output of this C code? int main() { int i = 0; for (foo(); i == 1; i = 2) printf("In for loopn"); printf("After loopn"); } int foo() { return 1; } a) After loop b) In for loop after loop c) Compile time error d) Infinite loop 28 What is the output of the code given below? int main() { printf("%d ", 1); goto l1; printf("%d ", 2); l1:goto l2; printf("%d ", 3); l2:printf("%d ", 4); } a) 1 4 b) 1 c) 1 2 4 d) 1 3 4 29 What is output of code given below? int main() { int i = 0, j = 0; while (i < 2) { l1 : i++; while (j < 3) { printf("Loopn"); goto l1; } } } a) Loop Loop b) Compilation error c) Loop Loop Loop Loop d) Infinite Loop 30 What is output of code given below? int main() { int i = 0, j = 0; while (i < 2) { l1 : i++; while (j < 3) { printf("Loopn"); goto l1; } } } a) loop loop b) Compilation error c) loop loop loop loop d) Infinite Loop
  • 5. 31 What is the output of the code given below? int main() { int i = 0, j = 0; l1: while (i < 2) { i++; while (j < 3) { printf("loopn"); goto l1; } } } a) loop loop b) compilation error c) loop loop loop loop d) infinite loop 32 The output of the code below is? void main() { int i = 0; if (i == 0) { goto label; } label: printf("Hello"); } a) Nothing b) Error c) Infinite Hello d) Hello 33 In the following loop construct, which one is executed only once always. for(exp1; exp2; exp3) a) exp1 b) exp3 c) exp1 and exp3 d) exp1, exp2 and exp3 34 Which keyword can be used for coming out of recursion? a) break b) return c) exit d) Both (a) and (b) 35 What is the output of this C code int main() { int a = 0, i = 0, b; for (i = 0;i < 5; i++) { a++; continue; } } a) 2 b) 3 c) 5 d) 4
  • 6. 36 What is the output of this C code int main() { int a = 0, i = 0, b; for (i = 0;i < 5; i++) { a++; if (i == 3) break; } } a) 1 b) 2 c) 3 d) 4 37 What is the output of this C code void main() { int i = 0; for (i = 0;i < 5; i++) if (i < 4) { printf("Hello"); break; } } a) Hello is printed 5 times b) Hello is printed 4 times c) Hello d) Hello is printed 3 times 38 What is the output of this C code? #include <stdio.h> struct student { int roll; char name[10]; }; void main() { struct student s; printf("%d", sizeof(s)); } a) 10 b) 2 c) 12 d) 8 39 What is the output of this C code? #include <stdio.h> union student { int roll; char name[10]; }; void main() { union student s; printf("%d", sizeof(s)); } a) 10 b) 20 c) 12 d) 8
  • 7. 40 Comment on the output of this C code? #include <stdio.h> struct temp { int a; int b; int c; }; main() { struct temp p[] = {{1, 2, 3}, {4, 5, 6}, {7, 8, 9}} } a) generates an array of structure of size 3 b) generates an array of structure of size 9 c) illegal declaration of a multidimensional array d) illegal assignment to members of structure 41 What is the output of C program with structures.? int main() { struct tree { int h; } struct tree tree1; tree1.h=10; printf("Height=%d",tree1.h); return 0; } a) Height=0 b) Height=10 c) Height= d) Height=2 42 How much memory space will be allocated in the following C code? #include <stdio.h> union emp { int id; float salary; char ename[10]; } e; a) Will be large enough to hold the largest of the three types; b) Will be large enough to hold the smallest of the three types; c) Will be large enough to hold the all of the three types; d) will be as per the requirement 43 What is the output of C program.? int main() { struct book { int pages; char name[10]; }a; a.pages=500; strcpy(a.name,"Let us C"); printf("%s=%d", a.name,a.pages); return 0; } a) Let us C=100 b) 100=Let us C c) Let us C 101 d) 100 Let us C
  • 8. 44 What is the output of this C code? #include <stdio.h> struct p { int k; char c; }; int p = 10; int main() { struct p x; x.k = 10; printf("%d %dn", x.k, p); } a) error b) garbage value c) 10 d) 10,10 45 Comment on the following C statement int (*a)[7]; a) An array “a” of pointers b) A pointer “a” to an array c) A simple array of size 7 d) None of the mentioned 46 A function can be invoked from another function using its ___ a) Value b) Return c) Name d) Variables 47 If the two strings are identical, then strcmp() function returns a) -1 b) 1 c) 0 d) None 48 What will be the output of the program ?#include<stdio.h> #include<string.h> int main() { char str1[20] = "Hello", str2[20] = " World"; printf("%sn", strcpy(str2, strcat(str1, str2))); return 0; } a) Hello b) Hello c) Hello World d) WorldHello 49 What will be the output of the program?#include<stdio.h> int i; int fun(); int main() { while(i) { fun(); main(); } printf("Hellon"); return 0; } int fun() { printf("Hi"); } a) Hello b) Hi Hello c) No output d) Infinite loop
  • 9. 50 What will be the output of the program ?#include<stdio.h> #include<string.h> int main() { static char str1[] = "dills"; static char str2[20]; static char str3[] = "Daffo"; int i; i = strcmp(strcat(str3, strcpy(str2, str1)), "Daffodills"); printf("%dn", i); return 0; } a) 0 b) 1 c) 2 d) 4
  • 10.
  • 11.
  • 12.
  • 13.
  • 14.
  • 15.
  • 16.
  • 17.
  • 18.
  • 19. 1 4 2 3 3 3 4 2 5 4 6 3 7 3 8 2 9 4 10 4 11 3 12 1 13 1 14 4 15 3 16 4 17 3 18 3 19 1 20 2 21 3 22 2 23 2 24 1 25 2 26 1 27 1 28 1 29 4 30 4 31 1 32 4 33 1 34 2 35 3 36 4 37 3 38 3 39 1 40 1 41 2 42 1 43 1 44 4 45 A pointer “a” to an array 46 Name 47 0 48 Hello World 49 Hello 50 0