0% found this document useful (0 votes)
109 views19 pages

Technical Answers

This document contains 52 multiple choice questions related to C programming and database concepts. The questions cover topics such as data types, operators, loops, functions, arrays, pointers, structures, sorting algorithms, memory allocation, database normalization forms, functional dependencies, and candidate keys. Sample questions are included to illustrate the technical nature and level of difficulty of the questions.

Uploaded by

lorame4500
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
109 views19 pages

Technical Answers

This document contains 52 multiple choice questions related to C programming and database concepts. The questions cover topics such as data types, operators, loops, functions, arrays, pointers, structures, sorting algorithms, memory allocation, database normalization forms, functional dependencies, and candidate keys. Sample questions are included to illustrate the technical nature and level of difficulty of the questions.

Uploaded by

lorame4500
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 19

Sample(technical)question for Employability skill III

Q1. What is the output of the following program?


#include<stdio.h>

main()
{
int i = 1;

while(++i <= 5)
printf("%d ",i++);
}
A) 1 3 5
B) 2 4
C) 2 4 6
D) 2

ANS: B

Q2. In C, what are the various types of real data type (floating point data
type)?
A) float, long double
B) long double, short int
C) float, double, long double
D) short int, double, long int, float
ANS: C
Q3. number of keywords present in c language are .?
A) 32
B) 34
C) 62
D) 64
ANS: A
Q4. Each statement in a c program should end with.?
A) semicolon ;
B) colon :
C) period . (dot symbol)
D) none of the above.
ANS: A
Q5. Choose a correct statement.
A) c compiler converts your c program into machine readable language.
B) c editor allows you to type c programs. it is just like a notepad with extra
options.
C) console shows the output of a c program if it is text output.
D) all the above
ANS: A

Q6. Find a correct c keyword below.


A) breaker
B) go to
C) shorter
D) default
ANS: D
Q7. Which data structure is used for recursion.
A) queue
B) stack
C) tree
D)graph
ANS: B
Q8. Size of float, double and long double in bytes are?
A) 4, 8, 16
B) 4, 8, 10
C) 2, 4, 6
D) 4, 6, 8
ANS: B
Q9. Choose a right statement.
int main()
{
float c = 3.5 + 4.5;
printf("%d", (int)C);

return 0;
}
A) 8.0
B) 8.000000
C) 7
D) 8
ANS: D
Q10. What will be the output of the following C code?
#include <stdio.h>
int main()
{
int c = 2 ^ 3;
printf("%d\n", C);
}
A) 1
B) 8
C) 9
D) 0
ANS: A
Q11.What will be the output of the following C code?
#include <stdio.h>
int main()
{
unsigned int a = 10;
a = ~a;
printf("%d\n", A);
}
A) -9
B) -10
C) -11
D) 10
ANS: C
Q12 What will be the output of the following C code?
#include <stdio.h>
int main()
{
if (7 & 8)
printf("Honesty");
if ((~7 & 0x000f) == 8)
printf("is the best policy\n");
}
A) Honesty is the best policy
B) Honesty
C) is the best policy
D) No output
ANS: C

Q13.What will be the output of the following C code?


#include <stdio.h>
int main()
{
int a = 2;
if (a >> 1)
printf("%d\n", A);
}
A) 0
B) 1
C) 2
D) No Output
ANS: C
Q14.Comment on the output of the following C code.
#include <stdio.h>
int main()
{
int i, n, a = 4;
scanf("%d", &n);
for (i = 0; i < n; i++)
a = a * 2;
}
A) Logical Shift left
B) No output
C) Arithmetic Shift right
D) Bitwise exclusive OR
ANS: B
Q15. What will be the output of the following C code?
#include <stdio.h>
void main()
{
int x = 97;
int y = sizeof(x++);
printf("x is %d", x);
}
A) x is 97
B) x is 98
C) x is 99
D) Run time error

ANS: A
Q16.What will be the output of the following C code?
#include <stdio.h>
void main()
{
int x = 4, y, z;
y = --x;
z = x--;
printf("%d%d%d", x, y, z);
}
A)3 2 3
B) 2 2 3
C) 3 2 2
D) 2 3 3

ANS: D

Q17. What will be the output of the following C code?


#include <stdio.h>
void main()
{
int x = 5;
if (x < 1)
printf("hello");
if (x == 5)
printf("hi");
else
printf("no");
}
A) hi
B) hello
C) no
D) error
ANS: A
Q18. What will be the output of the following C code?
#include <stdio.h>
int x;
void main()
{
if (x)
printf("hi");
else
printf("how are u");
}
A) hi
B) how are you
C) compile time error
D) error
ANS: B

Q19. What will be the output of the following C code?


#include <stdio.h>
void main()
{
int x = 5;
if (true);
printf("hello");
}
A) It will display hello
B) It will throw an error
C) Nothing will be displayed
D) Compiler dependent

ANS: B
Q20. What is the sizeof(void) in a 32-bit C?
A) 0
B) 1
C) 2
D) 4
ANS: B
Q21. There are two functional dependencies with the same set of attributes on the left side of the
arrow:

A->BC
A->B

This can be combined as

A. A->BC

B. A->B

C. B->C

D. None of the mentioned

Answers: A

Q22. Functional dependencies are classified as ___ on the left.

A. Dependent

B. Decomposition

C. Determinants

D. Database

Answers: C

Q23. If ___, then A -> B has trivial functional dependency.

A. B is a subset of A

B. A is a subset of B

C. A is a subset of A'

D. B is a subset of B'

Answer: A

Q24. Which of the following is a trivial functional dependency?

A. A->B, if B is a subset of A

B. A->A

C. B->B

D. All of the above

Answer: D
Q25. ______ on relational databases can be determined by using Armstrong's axioms.

A. Functional Independencies

B. Functional Dependencies

C. Fractional Independencies

D. Fraction Dependencies

Answer: B

Q26.Given an array int x[5][5] with starting address 6000 stored in row-major ordering.calculate the
address of x[3][4].

A. 6040

B. 6038

C. 6042

D. 6098

ANSWER: B

Q27. As part of maintenance work, you are entrusted with the work of rearranging the library books in a
shelf in proper order, at the end of each day. The ideal choice will be?
A. Insertion sort

B. Selection sort

C. Heap sort

D. Bubble sort

ANSWER: A

Q28. Which of the following header files must necessarily be included to use dynamic memory allocation
functions?

A. stdlib.h

B. stdio.h

C. memory.h

D. dos.h

Answer: A
Q29. Which of the following is an example for non linear data type?

A. Tree

B. Array

C. Linked list

D. Queue

Answer: A

Q.30. We use malloc and calloc for

A. Dynamic memory allocation

B. Static memory allocation

C. Both dynamic and static memory allocation

D. None of the above

Answer: A

31. When a relation contains an atomic value, it is a ___ relation.

A.1NF

B.2NF

C.3NF

D.BCNF

Answer: A

Q32. When a relation is in 2NF and there is ___, it is in 3NF.

A. Transition Dependency

B. No Transition Dependency
C. Relational Dependency

D. No Relational Dependency

Answer: B

Q33. What is TRUE about the First Normal Form (1NF)?

A. If a relation contains an atomic value, it will be 1NF.

B.A table attribute cannot contain more than one value, according to this rule.

C.A single-valued attribute can only be stored in it.

D. All of the above

Answers: D

Q34.Non-prime attributes cannot be transitively dependent, so the relation must have the ___ normal
form.

A. First

B. Second

C. Third

D. Fourth

Answer: C

Q35. Let R = (A, B, C, D, E, F) be a relation scheme with the following dependencies-

C→F E→A EC → D A → B

Which of the following is a key for R?

A. CD

B. EC

C. AE
D. AC

Answer: B

Q36.Find all the candidate keys of the relation R(A,B,C,D,E) with functional dependency

F={A-->B,AC-->D,D-->E, E-->A}

A. AC,CD,CE

B. AD,BD,CD

C. A,B,C

D. E,D,AB

Answer: A

Q37. What is the output?

void main()

int x=10;

printf(“%d”,++(x+5));

A) error

B) 15

C) 16

D) 17

ANS: A

Q38.What will be the output of the following C code?

#include <stdio.h>

int main()

int a = 10, b = 5, c = 3;
b != !a;

c = !!a;

printf("%d\t%d", b, C);

A) 5 1
B) 0 3
C) 5 3
D) 1 1
ANS: A

Q39.what is the output?

void main()

int i = 0, j = 1, k = 2, m;

m = i++ || j++ || k++;

printf("%d %d %d %d", m, i, j, k);

A. 1 1 2 3

B. 1 1 2 2

C. 0 1 2 2

D. 0 1 2 3

Answer: B

Q40.Suppose we’re debugging a quicksort implementation that is supposed to sort an array in ascending
order. After the first partition step has been completed, the contents of the array are in the following
order: 3 9 1 14 17 24 22 20 Which of the following statements is correct about the partition step?

A. The pivot could have been either 14 or 17

B. The pivot could have been 14, but could not have been 17

C. The pivot could have been 17, but could not have been 14 3.
D. Neither 14 nor 17 could have been the pivot

Answer: A

Q41. Very slow way of sorting is ..........

A. Insertion sort

B. Heap sort

C. Bubble sort

D. Quick sort

Q42.Choose a right statement. int a = 10 + 4.867;

A) a = 10

B) a = 14.867

C) a = 14

D) compiler error.

Q43.What is the output of the program.?

int main()

int a = 25%10;

printf("%d", a);

return 0;

A) 2.5

B) 2

C) 5

D) Compiler error.
Q44.What is the output of the C statement.?

int main()

int a=0;

a = 5<2 ? 4 : 3;

printf("%d",a);

return 0;

A) 4

B) 3

C) 5

D) 2

Q.45What is the output of C Program.?

int main()

int k;

for(printf("FLOWER "); printf("YELLOW "); printf("FRUITS "))

break;

}
return 0;

A) Compiler error

B) FLOWER FRUITS

C) FLOWER YELLOW

D) FLOWER YELLOW FRUITS

Answer: C

Q46. What is the way to suddenly come out of or quit any Loop in C Language.?

A) continue; statement

B) break; statement

C) leave; statement

D) quit; statement

Answer: B

Q47. Consider the relation scheme R(A, B, C, D, E, H) and the set of functional dependencies-

A→B

BC → D

E→C

D→A

What are the candidate keys of R?

A. AE, BE

B. AE, BE, DE

C. AEH, BEH, BCH

D. AEH, BEH, DEH

ANSWER: D

Q48.In mathematical term Table is referred as


(A) Relation

(B) Attribute

(C) Tuple

(D) Domain

Answer: A

Q49. Minimal Superkeys are called

(A) Schema keys

(B) Candidate keys

(C) Domain keys

(D) Attribute keys

Answer: B

Q50. A relation that has no partial dependencies is in which normal form

(A) First

(B) Second

(C) Third

(D) BCNF

Answer: B

Q51. Database management systems are intended to:

(A) Eliminate data redundancy

(B) Establish relationships among records in different files

(C) Manage file access

(D) All of the above

Answer: D

Q52.Which of the following is based on Multi Valued Dependency?

(A) First
(B) Second

(C) Third

(D) Fourth

Answer : D

Q53. The attribute that can be divided into other attributes is called

(A) Simple Attribute

(B) Composite Attribute

(C) Multi-valued Attribute

(D) Derived Attribute

Answer: B

Q54. In DBMS FD stands for _________

(A) Facilitate data

(B) Functional data

(C) Facilitate dependency

(D) Functional dependency

Answer: D

Q55. _______ allow us to identify uniquely a tuple in the relation.

(A) Superkey

(B) Domain

(C) Attribute

(D) Schema

Answer: A

Q56. If every non-key attribute is functionally dependent on the primary key, the relation will be in
(A) First Normal Form

(B) Second Normal Form

(C) Third Normal Form

(D) Fourth Formal Form

Answer: C

Q57. The Primary key must be

(A) Non Null

(B) Unique

(C) Option A or B

(D) Option A and B

Answer: D

Q58. Which of the following is the structure of the Database?

(A) Table

(B) Schema

(C) Relation

(D) None of these

Answer: C

Q59. A functional dependency between two or more non-key attributes is called

(A) Transitive dependency

(B) Partial transitive dependency

(C) Functional dependency

(D) Partial functional dependency

Answer: A

Q60.What can be a candidate key

A. Any attribute of relation


B. The closure having all attribute of relation

C. Any dependent of FD

D. none of the above

Answer: B

You might also like