KEMBAR78
C Language Objectives | PDF | Pointer (Computer Programming) | Computer Programming
0% found this document useful (0 votes)
17 views5 pages

C Language Objectives

Uploaded by

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

C Language Objectives

Uploaded by

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

id question a b c d answer

1 Which of the datatypes have size that is variable? int struct float double struct
C99 standard guarantees uniqueness of ____
2 characters for internal names. 31 62 63 14 63
C99 standard guarantess uniqueness of _____
3 characters for external names. 31 62 63 14 31
Which of the following is not a valid variable name
4 declaration? int __a3; int __3a; int __A3; None of the mentioned. None of the mentioned.
Which of the following is not a valid variable name
5 declaration? int __a3; int __3a; int __A3; int 3_a; int 3_a;

To avoid conflicts since To avoid conflicts since To avoid conflicts with To avoid conflicts since
Variable names beginning with underscore is not assemblers and loaders library routines use such environment variables of library routines use such
6 encouraged. Why? It is not standardized use such names names an operating system names

7 All keywords in C are in? Lower Case letters Upper Case letters Camel Case letters None of the mentioned. Lower Case letters
Which of the following cannot be a variable name
8 in C? Volatile TRUE friend export Volatile
9 enum types are processed by? Compiler Preprocessor Linker Assembler Compiler

Constant variables need Constant variables need


not be defined as they You cannot reassign a not be defined as they
are declared and can be Global constant variables const keyword is used to value to a constant are declared and can be
10 Which is false? defined later are initialised to zero define constant values variable defined later
You can change the
You cannot change the You cannot change the pointer as well as the You cannot change the
11 Comment on the following? const int *ptr; value pointed by ptr pointer ptr itself Both (a) and (b) value pointed by it value pointed by ptr
Which is an indirection operator among the
12 following? & * -> . *
Which of the following does not initialize ptr to
null (assuming variable declaration of a as int
13 a=0)? int *ptr = &a; int *ptr = &a – &a; int *ptr = a – a; All of the mentioned int *ptr = &a;
The function ____ obtains block of memory
14 dynamically. calloc malloc Both a & b free Both a & b
Pointer to n bytes of NULL if the request
15 void * malloc(size_t n) returns: uninitialized storage cannot be satisfied Nothing Both a & b are true Both a & b are true

16 calloc() returns a storage that is initialized to. Zero Null Nothing one Zero
Pointer returned by Pointer returned by
17 In function free(p), p is a: int malloc() calloc() Both b & c Both b & c
18 Memory allocation using malloc() is done in? Static area Stack area Heap area Both b & c Heap area
19 How will you free the allocated memory ? remove(var-name); free(var-name); delete(var-name); dalloc(var-name); free(var-name);
20 C programming language was developed by Dennis Ritchie Ken Thompson Bill Gates Peter Norton Dennis Ritchie
21 C is a ___ language High Level Low Level Middle Level Machine Level Middle Level
C language is available for which of the following
22 Operating Systems? DOS Windows Unix All of these All of these
Which of the following symbol is used to denote
23 a pre-processor statement? ! # ~ ; #
24 Which of the following is a Scalar Data type Float Union Array Pointer Float
25 Which of the following are tokens in C? Keywords Variables Constants All of the above All of the above
What is the valid range of numbers for int type of
26 data? 0 to 256 -32768 to +32767 -65536 to +65536 No specific range -32768 to +32767
Character constants should be enclosed between
27 ___ Single quotes Double quotes Both a and b None of these Single quotes
What will you do to treat the constant 3.14 as
28 a long double? use 3.14LD use 3.14L use 3.14DL use 3.14LF use 3.14L
Representation of NULL Representation of void Representation of NULL
29 What is (void*)0? pointer pointer Error None of above pointer

30 In which header file is the NULL macro defined? stdio.h stddef.h stdio.h and stddef.h math.h stdio.h and stddef.h
If a variable is a pointer to a structure, then which
of the following operator is used to access data
members of the structure through the pointer
31 variable? . & * -> ->
The keyword used to transfer control from a
32 function back to the calling function is switch goto go back return return

What will happen if in a C program you assign a The program may crash The program may crash
value to an array element whose subscript The element will be set The compiler would if some important data The array size would if some important data
33 exceeds the size of array? to 0. report an error. gets overwritten. appropriately grow. gets overwritten.
In C, if you pass an array as an argument to a Value of elements in First element of the Address of the last
34 function, what actually gets passed? array array Base address of the array element of array Base address of the array
You can also
concatenate several
String Literals can string constants If we want the
extend to more than a separating them by one string literal to explicitly
single line of code by or several blank spaces, made of wide characters,
putting a backslash sign tabulators,newline or we can precede the
at the end of each any other valid blank constant with the L
35 Which of the following statement is true? unfinished line. character prefix All of above All of above

It is not C++ statement This does not require a It is a C++ statement It is a C++ statement
Regarding #difine which of the following but the directive for the semicolon at the end of that declares a constant that declares a constant
36 statement is false? preprocessor line in C++ None of the above in C++

Constructs an integer
Declares a variable Declares a construction Declares a constant type variable with Declares a constant
Regarding following statement which of the pathwidth with 100 as its pathwidth with 100 as its pathwidth whose value pathwidth as identifier pathwidth whose value
37 statements is true?const int pathwidth=100; initial value initial value will be 100 and 100 as value will be 100

The rvalue might be a The assignment always


constant, a variable, an takes place from right to
The lvalue must always expression or any left and never the other
38 In an assignment statement be a variable combination of these way All of above All of above

39 The operator && is an example for ___ operator. Assignment Increment Logical Rational Logical
40 The operator & is used for Bitwise AND Bitwise OR Logical AND Logical OR Bitwise AND
41 The operator / can be applied to Integer values Float values Double values All of these Float values
42 The bitwise AND operator is used for Masking Comparison Division Shifting bits Masking
43 By default a real number is treated as a ? float double long double far double double
44 The binary equivalent of 5.375 is 101.1011101 101.011 101011 none of the above 101.011
In c, if you pass an array as an argument to a address of the last
45 function, what actully gets passed? value of element in array first element of the array base address of the array element of the array base address of the array

46 Which of the following are unary operator in C? ! sizeof ~ && &&

In which order do the following gets evaluated? 1.


47 Relational 2. Arithmetic 3.Logical 4.Assignment 2134 1234 4321 3214 2134
Reposition in the file Reposition in the file Reposition the file Reposition the file Reposition the file
pointer to a character pointer stream tfileo end pointer to begining of pointer to beginning of pointer to beginning of
48 What will the function rewind() d0? reverse. of file that line. file file
49 The address of a variable temp of type float is *temp &temp float& temp float temp& &temp

If an array is declared as int a[4] = {3, 0, 1, 2}, then


50 values assigned to a[0] & a[4] will be ________ 3, 2 0, 2 3, 0 0, 4 3, 0
What type of errors are checked during
51 compilation logical errors divide by zero error run - time errors syntax errors syntax errors

The minimum number of temporary variable


52 needed to swap the contents of two variable is 3 1 0 2 0
53 What is range of char data value? -64 to 64 -128 to 127 0 to 255 -127 to 128 -128 to 127
The process of repeating a group of statements in
54 an algorithm is known as sequence iteration flow selection iteration
scanf, printf and main
55 Every executable C program must contain a printf function functions main function scanf function main function

56 The individual units of a C program is known as records tokens units program tokens
code developed using
language independent refined version of the syntax of a specific outcome of compilation language independent
57 Pseudo code is code program language process code
58 A block is enclosed with pair of () {} <> [] {}
AT & T's Bell AT & T's Bell
Laboratories of USA in AT & T's Bell Laboritories Sun Microsystems in Cambridge University in Laboratories of USA in
59 C Language developed at? 1972 of USA in 1970 1973 1972 1972
For 16-bit compiler allowable range for integer
60 constant is? -3.4e38 to 3.4e38 -32767 to 32768 -32768 to 32767 -32668 to 32667 -32768 to 32767
C programs are converted into machine language
61 with the help of? An Editor A compiler An operating system none of the above A compler

A special symbol other


62 A C variable cannot start with? An alphabet A number than underscore both (b) and (c) both (b) and (c)
Which of the following is allowed in a C Arithmetic
63 instruction? [] {} () none of the above. ()
An array is not a
An array is a collection of An array is a collection of collection of variables An array is a collection of
variables that are of the variables that are of the that are of the same data variables that are of the
64 What is an array? dissimilar data type same data types. types. none of the above. same data types.
65 Bitwise operators can operate upon? double and chars floats and doubles ints and chars ints and floats ints and chars
the basic element
the smallest individual recognized by the the largest individuals
66 What is C tokens? units of c program complier units of program A & B both A & B both
Keywords have some keywords have some keywords have some keywords have some
predefine meanings and unknown meanings and predefine meanings and predefine meanings and
these meanings can be these meanings cannot these meanings cannot these meanings cannot
67 What is keywords? changed. be changed be changed none of the above be changed
Constants have fixed Constants have fixed
values that do not Constants have fixed constants have unknown values that do not
change during the values that change values that may be change during the
execution of the during the execution of a change during the execution of the
68 What is constant? program program execution of a program none of the above program

69 Which is the right way to declare constant in C? int constant var=10; int const var=10; const int var=10; B and C Both B and C Both

70 Which operator is known as Ternary operator? ::,? ?,: ?,;; none of the above ?,:
In switch statement, each case instance value
71 must be? Constant variable special symbol none of the above Constant
halt execution of restart execution of exit from loop or switch exit from loop or switch
72 Whta is the work of break keyword? program program statement none of the above statement

function is the
fundamental modular Function is a block of
function is a block of unit.A function is usually code that performs a
statements that perform designed to perform a specific task.It has a
73 What is function? some specific task specific task name and it is reusable All the above All the above

the body of the while the body of a do...while the body of a do..while a for loop can never be the body of a do...while
loop is executed atleast loop is executed atleast loop is executed zero or used in place of a while loop is executed atleast
74 Which one of the following sentences is true? once once more times loop once
A binary tree with 27 nodes has ___ null
75 branches? 54 27 26 none of the above none of the above
Which one of the following is not a linear data
76 structure? Array Binary Tree Queue Stack Binary Tree
77 Recursive functions are executed in a? FIFO order Load Balancing Parallel Fashion LIFO order LIFO order
78 Queue is a ____ list? LIFO LILO FILO FIFO FIFO

79 The statement printf(%d,10?0?5:1:12); will print? 10 0 12 1 1

To represent hierarchical relationship between


80 elements, which data structure is suitable? Priority Tree Dqueue All the above Tree

You might also like