0% found this document useful (0 votes)
19 views4 pages

1-Unit Bits

This document contains a quiz on concepts related to C programming. It includes 40 multiple choice questions testing knowledge of data types, variables, operators, functions, I/O and other basic C programming topics. The questions cover topics such as valid identifiers, loops, compilers, variable sizes, keywords and more.
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)
19 views4 pages

1-Unit Bits

This document contains a quiz on concepts related to C programming. It includes 40 multiple choice questions testing knowledge of data types, variables, operators, functions, I/O and other basic C programming topics. The questions cover topics such as valid identifiers, loops, compilers, variable sizes, keywords and more.
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/ 4

UNIT-1

(1). What is the valid identifier in the following


a) 1fdasgf b) @hgd12 c) fahs%* d) q1234
Answer: d

(2). Part of algorithm which is repeated for fixed number of times is classified as
a) Reverse action b) Iteration c) Sequence d) selection
Answer: b

(3).What symbol is used to represent the connector


a) parellogram b) rectangle with rounded end c) circle d) rectangle
Answer: c

(4).What is the output of this C code?


#include <stdio.h>
void main()
{
int b = 5 - 4 + 2 * 5;
printf("%d", b);
}
a) 25 b) -5 c) 11 d) None of the mentioned
Answer: c

(5). The ANSI C standard recognizes maximum length of a variable up to


a) 8 characters b) unlimited characters c) 31 characters d) 15 characters
Answer: c

(6). A compiler is a program that


a) Places programs into memory and prepares then for execution
b) Accepts a program written in a high level language and produces an object program
c) Automates the translation of assemble language into machine language
d) Appears to execute a resource as if it were machine language
Answer: b

(7).Which of the following is an incorrect variable name.


a) else b) name c) string d) age
Answer: a

(8). A system program that sets up an executable program in main memory ready for execution
a) Linker b) Assembler c) Loader d) Interpreter
Answer: c

(9).What is the size of long double variable


a) 10 bytes b) 8 bytes c) 4 bytes d) 16 bytes
Answer: a

(10).The errors that can be pointed out by the compiler are


a) logical errors b) internal errors c) semantic errors d) syntax errors
Answer: d
(11). If a is float variable, a=5/2 will return a value
a) 2.5 b) 2 c) 2.0 d) 3
Answer: c

(12).What is the smallest individual unit in a program?


a) Structure b) Function c) record d) Token
Answer: d

(13). The C language consists of _________ number of keywords


a) 26 b) 32 c) 36 d) 34
Answer: b

(14).Which of the following is an empty data type.


a) Integer b) float c) character d) void
Answer: d

(15).Which of the following C type is not a primitive data type?


a) char b) int c) struct d) float
Answer: c

(16). C is a……………………………………………..
a) Machine language
b) High level language
c) High level language with some low level features
d) Low level language
Answer: c

(17).What is the size of an int data type?


a) 4 bytes b) 8 bytes c) 16 bytes d) Depends on system/compiler
Answer: d

(18).Which of the following cannot be used as an identifier.


a) Alphabet followed by digit b) alphabet c) Keywords d) Library function name
Answer: c

(19).What is short int in C programming?


a) short is the qualifier and int is the basic data type
b) The basic data type
c) int is the qualifier and short is the basic data type
d) Qualifier
Answer: a

(20). The statement printf(“%d”,7);


a) prints 0 b) runtime error c) prints the value 7 d) results in syntax error
Answer: c
(21).Which of the following is TRUE about the declaration of symbolic constant?
a) #define PI=3.14159
b) #define PI 3.14159
c) #define PI 3.14158;
d) #define PI=3.14159;
Answer: b

(22).Which of the following is not a derived data type in c?


a)struct b) enum c)array d) function
Answer: b

(23). Character Set of C language contains?


a) Alphabets b) Digits c) Special Symbols d) All of these
Answer: d

(24). A variable name can have


a) Comma b) Any special symbol c) Underscore d) White space
Answer: c

(25). If both numerator and denominator of a division operation in C language are integers, then
we get?
a)Error b) real c)integer d)None
Answer: c

(26). The modifier which is used to declare a variable as constant


a) const b) constant c) CONSTANT d) CONST
Answer: a

(27). A variable of type signed int can have the following range of values
a) -32768 to +32768 b) 0 to 65535 c) -32768 to +32767 d) -32767 to +32768
Answer: c

(28).What is the size of float in 32-bit compiler? (In bytes)


a) 8 b) 6 c) 2 d) 4
Answer: d

(29).Which of the following declarations is valid?


a) char c="A"; b) char c='A'; c) char c=A; d) char c=1;
Answer: b

(30).The number of digits present after decimal in float is________.


a) 1 b) 3 c) 6 d) 16
Answer: c

(31).Who developed the C programming language


a) James Gosling b) Ray Boyce c) Charles Babbage d) Dennis Ritchie
Answer: d
(32).Loss in precision occurs for typecasting from____________.
a) char to short b) float to double c) long to float d) float to int
Answer: d

(33).What is range of char data value?


a) -64 to 64
b) -128 to 127
c) 0 to 255
d) -127 to 128
Answer: b

(34).An algorithm is
a) A chart showing the flow of a series of events
b) A decision arrived at by following instructions
c) Step-by-step instructions used to solve a problem
d) A computer program that follows a chart
Answer: c

(35). In flow chart, diamond shaped symbol is used to represent


a) predefined process b) statement box c) error box d) decision box
Answer: d

(36).Variables are initialized in C, using


a): = b) > c) = d) = =
Answer: c

(37).What symbol do flowcharts use to show an input or output?


a) Parallelogram b) Rectangle c) diamond d) Oval
Answer: a

(38).Which of the following is not a valid variable name declaration?


a) int _a3; b) int a_3; c) int 3_a; d) int _3a;
Answer: c

(39). %lu access specifier is used for


a) Strings b) Integral types c) Floating type d) All of the mentioned
Answer: b

(40). A name having a few alphabets, digits, and a special character underscore ( _ ) is called
a) Identifiers b) keywords c) C tokens d) constants
Answer: a

You might also like