Вы находитесь на странице: 1из 53

1)LPC2148 is having______Ports.

a)2 b)3 c) 4 d)5

2)Header files increases overhead of______ and Convenienceof ______.


a)Programmer,Compiler b)Compiler,Programmer
c)CPU,Compiler d)Compiler,CPU

3)Always,____ file of program is downloaded in Microcontroller.


a)C file b)Asembly file c)Object File d)Hex file

4)What is full form of ISP?


a)International Standard Protocol b)

5) System and user mode are _____ &_____ respectively.


a)both Privilegded b) both Non-Privilegded
c) Privilegded and NonPrivilegded d)Non-Privilegded and Privilegded

6)ARM7 has ___ total registers.


a)32 b)64 c)37 d)40
7)ARM 7instruction’s opcode is of ____bits.
a)64 b)32 c)40 d)2
8)ARM’s Thumb instruction set is of____bits.
a)64 b)32 c)40 d)2
9)r13 register in ARM7 is _____register.
a)Link b)PC c)SP d)CPSR

a)LPC
b)TDMI
c)IDE
d)ISP
e)ARM
f)CPSR & SPSR
g)RISC

1. ARM stands for _____________ .


a) Advanced Rate Machines
b) Advanced RISC Machines
c) Artificial Running Machines
d) Aviary Running Machines
View Answer

2. The main importance of ARM micro-processors is providing operation with,


a) Low cost and low power consumption
b) Higher degree of multi-tasking
c) Lower error or glitches
d) Efficient memory management
View Answer

3. ARM processors where basically designed for _______ .


a) Main frame systems
b) Distributed systems
c) Mobile systems
d) Super computers
View Answer

4. The ARM processors doesn’t support Byte address ability ?


a) True
b) False
View Answer

5. The address space in ARM is ______ .


a) 2^24
b) 2^64
c) 2^16
d) 2^32
View Answer

6. The address system supported by ARM systems is/are ______ .


a) Little Endian
b) Big Endian
c) X-Little Endian
d) Both a and b
View Answer

7. Memory can be accessed in ARM systems by _____ instructions .


i) Store
ii) MOVE
iii) Load
iv) arithmetic
v) logical
a) i,ii,iii
b) i,ii
c) i,iv,v
d) iii,iv,v
View Answer

8. RISC stands for _________ .


a) Restricted Instruction Sequencing Computer
b) Restricted Instruction Sequential Compiler
c) Reduced Instruction Set Computer
d) Reduced Induction Set Computer
View Answer
9. In ARM, PC is implemented using ____ .
a) Caches
b) Heaps
c) General purpose register
d) Stack
View Answer

10. The additional duplicate register used in ARM machines are called as
_______ .
a) Copied-registers
b) Banked registers
c) EXtra registers
d) Extential registers
View Answer

11. The banked registers are used for,


a) Switching between supervisor and interrupt mode
b) Extended storing
c) Same as other general purpose registers
d) Both a and c
View Answer

12. Each instruction in ARM machines is encoded into ____ Word .


a) 2 byte
b) 3 byte
c) 4 byte
d) 8 byte
View Answer

13. All instructions in ARM are conditionally executed .


a) True
b) False
View Answer

14. The addressing mode where the EA of the operand is the contents of Rn is
______ .
a) Pre-indexed mode
b) Pre-indexed with write back mode
c) Post-indexed mode
d) None of the above
View Answer

15. The effective address of the instruction written in Post-indexed mode,


MOVE[Rn]+Rm is _______ .
a) EA = [Rn] b) EA = [Rn + Rm] c) EA = [Rn] + Rm
d) EA = [Rm] + Rn

1. ____ symbol is used to signify write back mode .


a) #
b) ^
c) &
d) !
View Answer

2. The instructions which are used to load or store multiple operands are called
as _____ .
a) Banked instructions
b) Lump transfer instructions
c) Block transfer instructions
d) DMA instructions
View Answer
3. The Instruction, LDM R10!,{R0,R1,R6,R7} ______ .
a) Loads the contents of R10 into R1,R0,R6 and R7
b) Creates a copy of the contents of R10 in the other registers except the above
mentioned ones
c) Loads the contents of the registers R1,R0,R6 and R7 to R10
d) Writes the contents of R10 into the above mentioned registers and clears R10
View Answer

4. The instruction, MLA R0,R1,R2,R3 performs _________ .


a) R0<-[R1]+[R2]+[R3] b) R3<-[R0]+[R1]+[R2] c) R0<-[R1]*[R2]+[R3] d) R3<-
[R0]*[R1]+[R2] [expand title="View Answer"] Answer:c Explanation: The MLA
instruction is used perform addition and multiplication together.[/expand]

5. The ability to shift or rotate in the same instruction along with other operation is
performed with the help of _________ .
a) Switching circuit
b) Barrel switcher circuit
c) Integrated Switching circuit
d) Multiplexer circuit
View Answer

6. _____ instruction is used to get the 1’s compliment of the operand .


a) COMP
b) BIC
c) ~CMP
d) MVN
View Answer

7. The offset used in the conditional branching is ____ bit .


a) 24
b) 32
c) 16
d) 8
View Answer

8. The BEQ instructions is used,


a) To check the equality condition between the operands and then branch
b) To check if the Operand is greater than the condition value and then branch
c) To check if the flag Z is set to 1 and then causes branch
d) None of the above
View Answer

9. The condition to check whether the branch should happen or not is given by,
a) The lower order 8 bits of the instruction
b) The higher order 4 bits of the instruction
c) The lower order 4 bits of the instruction
d) The higher order 8 bits of the instruction
View Answer

10. Which of the two instructions sets the condition flag upon execution ?
i) ADDS R0,R1,R2
ii) ADD R0,R1,R2
a) i
b) ii
c) Both i and ii
d) Insufficient data
View Answer

11. ____ directive is used indicate the beginning of the program instruction or
data .
a) EQU
b) START
c) AREA
d) SPACE
View Answer

12. _____ directive specifies the start of the execution .


a) START
b) ENTRY
c) MAIN
d) ORIGIN
View Answer

13. _____ directives are used to initialize operands .


a) INT
b) DATAWORD
c) RESERVE
d) DCD
View Answer

14. _____ directive is used to name the register used for execution of an
instruction .
a) ASSIGN
b) RN
c) NAME
d) DECLARE
View Answer

15. THe pseudo instruction used to load address into the register is ______ .
a) LOAD
b) ADR
c) ASSIGN
d) PSLOAD
View Answer

http://www.sanfoundry.com/computer-organization-mcqs-cisc-risc-processors/

This set of Computer Organisation and Architecture MCQs focuses on “CISC And RISC Processors
“.
1. The CISC stands for
a) Computer Instruction Set Compliment
b) Complete Instruction Set Compliment
c) Computer Indexed Set Components
d) Complex Instruction set computer
View Answer

2. The computer architecture aimed at reducing the time of execution of


instructions is ________.
a) CISC
b) RISC
c) ISA
d) ANNA
View Answer

Answer:b
Explanation: <numeric> The RISC stands for Reduced Instruction Set Computer.
3. The Sun micro systems processors usually follow _____ architecture.
a) CISC
b) ISA
c) ULTRA SPARC
d) RISC
View Answer

4. The RISC processor has a more complicated design than CISC.


a) True
b) False
View Answer

Answer:b
Explanation: <numeric> The RISC processor design is more simpler than CISC and it consists of
fewer transistors.
5. The iconic feature of the RISC machine among the following are
a) Reduced number of addressing modes
b) Increased memory size
c) Having a branch delay slot
d) All of the above
View Answer

6. Both the CISC and RISC architectures have been developed to reduce the
______.
a) Cost
b) Time delay
c) Semantic gap
d) All of the above
View Answer

7. Out of the following which is not a CISC machine.


a) IBM 370/168
b) VAX 11/780
c) Intel 80486
d) Motorola A567
View Answer

8. Pipe-lining is a unique feature of _______.


a) RISC
b) CISC
c) ISA
d) IANA
View Answer

9. In CISC architecture most of the complex instructions are stored in _____.


a) Register
b) Diodes
c) CMOS
d) Transistors
View Answer

10. Which of the architecture is power efficient?


a) CISC
b) RISC
c) ISA
d) IANA
View Answer

1. The smallest entity of memory is called as _______ .


a) Cell
b) Block
c) Instance
d) Unit
View Answer

Answer:a
Explanation: Each data is made up of a number units.
2. The collection of the above mentioned entities where data is stored is called as
______ .
a) Block
B) Set
c) Word
d) Byte
View Answer

3. An 24 bit address generates an address space of ______ locations .


a) 1024
b) 4096
c) 2 ^ 48
d) 16,777,216
View Answer

4. If a system is 64 bit machine , then the length of each word will be ____ .
a) 4 bytes
b) 8 bytes
c) 16 bytes
d) 12 bytes
View Answer

5. The type of memory assignment used in Intel processors is _____ .


a) Little Endian
b) Big Endian
c) Medium Endian
d) None of the above
View Answer

6. When using the Big Endian assignment to store a number, the sign bit of the
number is stored in _____ .
a) The higher order byte of the word
b) The lower order byte of the word
c) Can’t say
d) None of the above
View Answer
7. To get the physical address from the logical address generated by CPU we
use ____ .
a) MAR
b) MMU
c) Overlays
d) TLB
View Answer

8. _____ method is used to map logical addresses of variable length onto


physical memory.
a) Paging
b) Overlays
c) Segmentation
d) Paging with segmentation
View Answer

9. During transfer of data between the processor and memory we use ______ .
a) Cache
b) TLB
C) Buffers
d) Registers
View Answer

10. Physical memory is divided into sets of finite size called as ______ .
a) Frames
b) Pages
c) Blocks
d) Vectors
View Answer
1. Add #%01011101,R1 , when this instruction is executed then,
a) The binary addition between the operands takes place
b) The Numerical value represented by the binary value is added to the value of
R1
c) The addition doesn’t take place , whereas this is similar to a MOV instruction
d) None of the above
View Answer

2. If we want to perform memory or arithmetic operations on data in Hexa-


decimal mode then we use ___ symbol before the operand .
a) ~
b) !
c) $
d) *
View Answer

3. When generating physical addresses from logical address the offset is stored
in _____ .
a) Translation look-aside buffer
b) Relocation register
c) Page table
d) Shift register
View Answer

4. The technique used to store programs larger than the memory is ______ .
a) Overlays
b) Extension registers
c) Buffers
d) Both b and c
View Answer
5. The unit which acts as an intermediate agent between memory and backing
store to reduce process time is _____ .
a) TLB’s
b) Registers
c) Page tables
d) Cache
View Answer

6. The Load instruction does the following operation/s,


a) Loads the contents of a disc onto a memory location
b) Loads the contents of a location onto the accumulators
c) Load the contents of the PCB onto the register
d) Both a and c
View Answer

7. Complete the following analogy :- Registers are to RAM’s as Cache’s are to


_____ .
a) System stacks
b) Overlays
c) Page Table
d) TLB
View Answer

Answer:d
Explanation: None.
8. The BOOT sector files of the system are stored in _____ .
a) Harddisk
b) ROM
c) RAM
d) Fast solid state chips in the motherboard
View Answer
Answer:b
Explanation: The files which are required for the starting up of a system are stored on the ROM.
9. The transfer of large chunks of data with the involvement of the processor is
done by _______ .
a) DMA controller
b) Arbitrator
c) User system programs
d) None of the above
View Answer

10. Which of the following technique/s used to effectively utilize main memory ?
a) Address binding
b) Dynamic linking
c) Dynamic loading
d) Both b and c
View Answer

1. ____ converts the programs written in assembly language into machine


instructions .
a) Machine compiler
b) Interpreter
c) Assembler
d) Converter
View Answer

2. The instructions like MOV or ADD are called as ______ .


a) OP-Code
b) Operators
c) Commands
d) None of the above
View Answer
3. The alternate way of writing the instruction, ADD #5,R1 is ______ .
a) ADD [5],[R1];
b) ADDI 5,R1;
c) ADDIME 5,[R1];
d) There is no other way
View Answer

4. Instructions which wont appear in the object program are called as _____ .
a) Redundant instructions
b) Exceptions
c) Comments
d) Assembler Directives
View Answer

5. The assembler directive EQU, when used in the instruction : Sum EQU 200
does,
a) Finds the first occurrence of Sum and assigns value 200 to it
b) Replaces every occurrence of Sum with 200
c) Re-assigns the address of Sum by adding 200 to its original address
d) Assigns 200 bytes of memory starting the location of Sum
View Answer

6. The purpose of the ORIGIN directive is,


a) To indicate the starting position in memory, where the program block is to be
stored
b) To indicate the starting of the computation code
c) To indicate the purpose of the code
d) To list the locations of all the registers used
View Answer
7. The directive used to perform initialization before the execution of the code is
______ .
a) Reserve
b) Store

c) Dataword
d) EQU
View Answer

8. _____ directive is used to specify and assign the memory required for the
block of code .
a) Allocate
b) Assign
c) Set
d) Reserve
View Answer

9. _____ directive specifies the end of execution of a program .


a) End
b) Return
c) Stop
d) Terminate
View Answer

10. The last statement of the source program should be _______ .


a) Stop
b) Return
c) OP
d) End
View Answer
11. When dealing with the branching code the assembler,
a) Replaces the target with its address
b) Does not replace until the test condition is satisfied
c) Finds the Branch offset and replaces the Branch target with it
d) Replaces the target with the value specified by the DATAWORD directive
View Answer

12. The assembler stores all the names and their corresponding values in
______ .
a) Special purpose Register
b) Symbol Table
c) Value map Set
d) None of the above
View Answer

13. The assembler stores the object code in ______ .


a) Main memory
b) Cache
c) RAM
d) Magnetic disk
View Answer

14. The utility program used to bring the object code into memory for execution is
______.
a) Loader
b) Fetcher
c) Extractor
d) Linker
View Answer
15. To overcome the problems of the assembler in dealing with branching code
we use _____ .
a) Interpreter
b) Debugger
c) Op-Assembler
d) Two-pass assembler
View Answer

This set of Computer Organisation and Architecture MCQ focuses on “USB”.


1. The transfer rate, when the USB is operating in low-speed of operation is
_____.
a) 5 Mb/s
b) 12 Mb/s
c) 2.5 Mb/s
d) 1.5 Mb/s
View Answer

Answer:d
Explanation: The USB has two rates of operation the low-speed and the full-speed one.
2. THe high speed mode of operation of the USB was introduced by _____.
a) ISA
b) USB 3.0
c) USB 2.0
d) ANSI
View Answer

Answer:c
Explanation: The high-speed mode of operation was introduced with USB 2.0,which enabled the
USB to operatte at 480 Mb/s.
3. The sampling process in speaker output is a ________ process.
a) Asynchronous
b) Synchronous
c) Isochronous
d) None of the above
View Answer

Answer:c
Explanation: The isochronous process means each bit of data is seperated by a time interval.
4. The USB device follows _______ structure.
a) List
b) Huffmann
c) Hash
d) Tree
View Answer

Answer:d
Explanation: The USB has a tree structure with the root hub at the centre.
5. The I/O devices form the _____ of the tree structure.
a) Leaves
b) Subordinate roots
c) Left sub trees
d) Right sub trees
View Answer

Answer:a
Explanation: The I/o devices form the leaves of the structure.
6. USB is a parallel mode of transmission of data and this enables for the fast
speeds of data transfers.
a) True
b) False
View Answer

Answer:b
Explanation: The USB does a serial mode of data transfer.
7. In USB the devices can communicate with each other.
a) True
b) False
View Answer

Answer:b
Explanation: It allows only the host to communicate with the devices and not between themselves.
8. The device can send a message to the host by taking part in _____ for the
communication path.
a) Arbitration
b) Polling
c) Prioritising
d) None of the above
View Answer

Answer:b
Explanation: None.
9. When the USB is connected to a system, its root hub is connected to the
________.
a) PCI BUS
b) SCSI BUS
c) Processor BUS
d) IDE
View Answer

Answer:c
Explanation: The USB’s root is connected to the processor directly using the BUS.
10. The devices connected to USB is assigned an ____ adrress.
a) 9 bit
b) 16 bit
c) 4 bit
d) 7 bit
View Answer

Answer:d
Explanation: To make it easier for recognition the devices are given 7 bit addresses.
11. The USB address space can be shared by the user’s memory space.
a) True
b) False
View Answer

Answer:b
Explanation: The USB memory space is not under any address sapces and cannot be accessed.
12. The initial address of a device just connected to the HUB is ____ .
a) AHFG890
b) 0000000
c) FFFFFFF
d) 0101010
View Answer

Answer:b
Explanation: By standard the usual address of a new device is zero.
13. Locations in the device to or from which data transfers can take place is
called ____.
a) End points
b) Hosts
c) Source
d) None of the above
View Answer

Answer:a
Explanation: None.
14. A USB pipe is a ______ channel.
a) Simplex
b) Half-Duplex
c) Full-Duplex
d) Both a and c
View Answer

Answer:c
Explanation: This means that the pipe is bi-directional in sending messages or information.
15. The type/s of packets sent by the USB is/are _______.
a) Data
b) Address
c) Control
d) Both a and c
View Answer

Answer:d
Explanation: This means that the usb gets both data and control signlas required for the transfer
operation.
This set of Computer Organisation and Architecture MCQ focuses on “USB”.
1. The first feild of any packet is _____.
a) PID
b) ADDR
c) ENDP
d) CRC16
View Answer

2. The 4 bit PID’s are transmitted twice.


a) True
b) False
View Answer

3. The last field in the packet is ______.


a) PID
b) ADDR
c) ENDP
d) CRC
View Answer

4. The CRC bits are computed based on the values of the _____.
a) PID
b) ADDR
c) ENDP
d) Both b and c
View Answer

5. The data packets can contain data upto ______.


a) 512 bytes
b) 256 bytes
c) 1024 bytes
d) 2 KB
View Answer

6. The most important objective of the USB is to provide ______.


a) Isochronous transmission
b) Plug and play
c) Easy device connection
d) All of the above
View Answer

7. The transmission over the USB is divided into ____.


a) Frames
b) Pages
c) Packets
d) Tokens
View Answer
8. The _____ signal is used to indiacate the beginning of a new frame.
a) Start
b) SOF
c) BEG
d) None of the above
View Answer

9. The SOF is transmitted every ______.


a) 1s
b) 5s
c) 1ms
d) 1Us
View Answer

10. The power specification of usb is _____.


a) 5v
b) 10v
c) 24v
d) 10v
View Answer

1. ______ have been developed specifically for pipelined systems.


a) Utility softwares
b) Speed up utilities
c) Optimizing compilers
d) None of the mentioned
View Answer

Answer:c
Explanation: <numeric> The compilers which are designed to remove redundant parts of the code
are called as optimizing compilers.
2. The pipelining process is also called as ______.
a) Superscalar operation
b) Assembly line operation
c) Von neumann cycle
d) None of the mentioned
View Answer

Answer:b
Explanation: <numeric> It is called so because it performs its operation at assembly level.
3. The fetch and execution cycles are interleaved with the help of ________.
a) Modification in processor architecture
b) Clock
c) Special unit
d) Control unit
View Answer

Answer:b
Explanation: <numeric> The time cycle of the clock is adjusted to perform the interleaving.
4. Each stage in pipelining should be completed within ____ cycle.
a) 1
b) 2
c) 3
d) 4
View Answer

Answer:a
Explanation: <numeric> The stages in the pipelining should get completed within one cycle to
increase the speed of performance.
5.In pipelining the task which requires the least time is performed first.
a) True
b) False
View Answer
6. If a unit completes its task before the allotted time period, then
a) It’ll perform some other task in the remaining time
b) Its time gets reallocated to different task
c) It’ll remain idle for the remaining time
d) None of the mentioned
View Answer

7. To increase the speed of memory access in pipelining, we make use of


_______.
a) Special memory locations
b) Special purpose registers
c) Cache
d) Buffers
View Answer

8. The periods of time when the unit is idle is called as _____.


a) Stalls
b) Bubbles
c) Hazards
d) Both a and b
View Answer

9. The contention for the usage of a hardware device is called as ______.


a) Structural hazard
b) Stalk
c) Deadlock
d) None of the mentioned
View Answer

10. The situation where in the data of operands are not available is called
______.
a) Data hazard
b) Stock
c) Deadlock
d) Structural hazard
View Answer

1)There are ____pins available for EINT3 in LPC2148. a)3 b)2 c)Only 1 d)4
2)There are ____GPIO pins in LPC2148. a)64 b)61 c)45 d)46
3)ADC module 0 in LPC2148 has ____i/ps channles. a)2 b)6 c)8 d)none of above
4)There are ____Capture modules in LPC2148. a)2 b)3 c)4 d)5
5)There are _____submodules in each Capture module. a)4 b)2 c)5 d)3
1)There are ____pins available for EINT2in LPC2148. a)3 b)2 c)Only 1 d)4
2)There are _____32bits timer in LPC2148 . a)2 b)3 c)4 d)5
3)ADC module 1 in LPC2148 has ____i/ps channels. a)2 b)6 c)8 d)none of above
4)There are ____Compare modules in LPC2148. a)2 b)3 c)4 d)5
5)There are _____PWM modules in LPC2148. a)4 b)2 c)6 d)3

3) In LCD, which hex command performs the function of 'Display on, cursor on and blinking'?

a. 0x0A
b. 0x0C
c. 0x0E
d. 0x0F
Answer Explanation

4) In LCD, which function is executed by '0x05' hex command?

a. Shift display left


b. Shift display right
c. Clear display
d. Return cursor to home
Answer Explanation

5) For the supplied data, which edge level is necessary for LCD in order to latch the data?
a. High-to-Low
b. Low-to-High
c. High-to-High
d. Low-to-Low
Answer Explanation

6) In LCD, which pin/s is/are used to latch the data into the data register or command register?

a. RS pin
b. R/W
c. E
d. All of the above
Answer Explanation

7) What is the size range of the alphanumeric LCDs?

a. 1 to 8 characters
b. 8 to 80 characters
c. 100 to 150 characters
d. 250 to 400 characters
Answer Explanation

8) In LPC 2148, which among the following is/are the functions of Mask register?

a. Byte addressability
b. Relocation to ARM local bus for fastest posible I/O timing
c. Treating sets of port bits in the form of group without changing other bits
d. All of the above
Answer Explanation

9) In DAC 0808, what is the high speed multiplying input slew rate?

a. 2 mA/μ sec
b. 4 mA/μ sec
c. 8 mA/μ sec
d. 16 mA/μ sec
Answer Explanation

10) In DAC 0808, which among the following is configured as a reference in addition to R-2R ladde
and current switches?

a. Voltage amplifier
b. Current amplifier
c. Transconductance amplifier
d. Transresistance amplifier

C-Dac Sample quesion paper - pattern 1

Fundamentals of Programming

1.The programming language that was designed for specifying algorithm

Address

ASCII

ALGOL

None of these options

2. _____ contains the addresses of all the records according to the contents of the field designed as the
record key.

Index<------ans
Subscript

Array

File

3. _________ symbol is used for Processing of data.

Oval

Parallelogram<------ans

Rectangle

Diamond

4. __________ is the analysis tool used for planning program logic

Protocol

None of these options

PROLOG

Pseudocode

5. Machine language has two part format the first part is__________ and the second part is __________

OPCODE,OPERAND<------ans

OPERAND,OPCODE

DATA CODE,OPERAND

OPERAND,CODEOP

6. Language Primarily used for internet-based applications


ADA

C++

JAVA;------ans

FORTRAN

7. _________ is a point at which the debugger stops during program execution and awaits a further
command.

Memory Dump

Watch point<------ans

Break point

None of these options

8. ________do not contain any program logic and are ignored by the language Processor

Protocol

Virus

Comment

None of these options

9. The component of data base management system is ________

Data definition Language

Data manipulation Language

Data definition Language and Data manipulation Language

None of these options

10. The quality of Algorithm is judged on the basis of_________


Time requirement

Memory Requirement

Accuracy of solution

All of these options<------ans

11. Advantages of using flow charts is

Effective Analysis

Efficient Coding

Time consuming

Effective Analysis and Efficient Coding<-----ans

Programming in C

12. The Real constants in C can be expressed in which of the following forms

Fractional form only

Exponential form only

ASCII form only

Both Fractional and Exponential forms<------ans

13. The program, which translates high-level program into its equivalent machine language program, is
called

Transformer

Language processor

Converter
None of these options<------ans<!--[if !supportEmptyParas]-->

14. Consider the following statements. i.Multiplication associates left to right ii.Division associates left to
right

iii.Unary Minus associates right to left

iv.subtraction associates left to right All are true <------ans

only i and ii are true

all are false

only iii and iv are true

15. What will be the value of variable a in the following code?

unsigned char a;

a = 0xFF + 1;

printf("%d", a);

0xFF

0x100

0 <------ans

0x0

16. What is the output of the following program?

#include <stdio.h>

void main()

printf("\n10!=9 : %5d",10!=9);
}

1<------ans

Error

None of these options

17. #include<stdio.h>

void main()

int x=10;

(x<0)?(int a =100):(int a =1000);

printf(" %d",a);

Error<------ans

1000

100

None of these options

18. Which of the following shows the correct hierarchy of arithmetic operations in C

(), **, * or /, + or -

(), **, *, /, +, -

(), **, /, *, +, -

(), / or *, - or + <-----Ans

19. What is the output of the following code?


#include<stdio.h>

void main()

int a=14;

a += 7;

a -= 5;

a *= 7;

printf("\n%d",a);

112<------ans

98

89

None of these options

20. What is the output of the following code? #include<stdio.h>

#define T t

void main()

char T = `T`;

printf("\n%c\t%c\n",T,t);

Error

Tt
TT

tt

21. The statement that prints out the character set from A-Z, is

for( a = `z`; a < `a`; a = a - 1)

printf("%c", &a);

for( a = `a`; a <= `z`; a = a + 1

printf("%c", &a);

for( a = `A`; a <= `Z`; a = a + 1)<----Ans printf("%c", a);

for( a = `Z`; a <= `A`; a = a + 1)

printf("%c", a);

22. The statement which prints out the values 1 to 10 on separate lines, is

for( count = 1; count <= 10; count = count + 1) printf("%d\n",count);

for( count = 1; count < 10; count = count + 1) printf("%d\n",count);<------ans

for( count = 0; count <= 9; count = count + 1) printf("%d ",count);

for( count = 1; count <> 10; count = count + 1) printf("%d\n",count);

23. What does the term `call-by-reference` refer to?

Passing a copy of a variable into a function. Passing a pointer to a variable into a function. <------ans

Choosing a random value for a variable.

A function that does not return any values.

24. What is the output of the following code? #include<stdio.h>

void swap(int&, int&);


void main()

int a = 10,b=20;

swap (a++,b++);

printf("\n%d\t%d\t",a, b);

void swap(int& x, int& y)

x+=2;

y+=3;

14, 24

11, 21 <------ans

10, 20

Error

25. What is the output of the following program code

#include<stdio.h>

void abc(int a[])

a++;

a[1]=612;

main()
{

char a[5];

abc(a);

printf("%d",a[4]);

100

612

Error<------ans

None of these options

26. which of the following is true about recursive function

i. it is also called circular definition

ii. it occurs when a function calls another function more than once

iii. it occurs when a statement within the function calls the function itself

iv. a recursive function cannot have a return statement within it"

i and iii<------ans

i and ii

ii and iv

i, iii and iv

27.What will happen if you assign a value to an element of an array whose subscript exceeds the size of the
array?

The element will be set to 0

Nothing, its done all the time

Other data may be overwritten


Error message from the compiler

28. What is the output of the following code? #include<stdio.h>

void main()

int arr[2][3][2]={{{2,4},{7,8},{3,4},}, {{2,2},{2,3},{3,4}, }}; printf("\n%d",**(*arr+1)+2+7);

16 <------ans

11

Error

29. If int s[5] is a one dimensional array of integers, which of the following refers to the third element in the
array?

*( s + 2 ) <------ans

*( s + 3 )

s+3

s+2

30. #include"stdio.h"

main()

int *p1,i=25;

void *p2;
p1=&i;

p2=&i;

p1=p2;

p2=p1;

printf("%d",i);

The output of the above code is :

Program will not compile <------ans

25

Garbage value

Address of I

31. What is the output of the following code? void main()

int i = 100, j = 200;

const int *p=&i;

p = &j;

printf("%d",*p);

100

200 <------ans

300

None of the above


32. void main()

int i=3;

int *j=&i;

clrscr();

printf("%d%d",++*j,*(&i));

What is the output of this program?

33

4 3 <------ans

4,address of i printed

Error:Lvalue required

33. What is the output of the following code? #include<stdio.h>

void main()

int arr[] = {10,20,30,40,50};

int *ptr = arr;

printf("\n %d\t%d\t",*ptr++,*ptr);

10 20

10 10<------ans

20 20

20 10
34. Which of these are reasons for using pointers?

1.To manipulate parts of an array

2.To refer to keywords such as for and if

3.To return more than one value from a function 4.To refer to particular programs more conveniently

1 & 3 <------ans

Only 1

Only 3

All of the above

35. struct num

int no;

char name[25];

};

void main()

struct num n1[]={{25,"rose"},{20,"gulmohar"}, {8,"geranium"},{11,"dahalia"}};

printf("%d%d" ,n1[2].no,(*&n1+2)->no+1);

What is the output of this program?

88

8 9 <------ans
98

8 , unpredictable

36. During initializing a union

Only one member can be initialised.

All the members will be initialised. Initialisation of a union is not possible.<------ans

None of these options

37. Self referential structure is one

a. Consisting the structure in the parent structure

b. Consisting the pointer of the structure in the parent structure

Only a

Only b

Both a and b

Neither a nor b

38. Individual structure member can be initialized in the structure itself

True

False

Compiler dependent

None of these options

39. Which of the following is the feature of stack?

All operations are at one end

It cannot reuse its memory


All elements are of different data types

Any element can be accessed from it directly<------ans

40. When stacks are created

Are initially empty<------ans

Are initialized to zero

Are considered full

None of these options

41. What is time required to insert an element in a stack with linked implementation?

(1)

(log2n)<------ans

(n)

(n log2n)

42. Which of the following is the feature of stack?

All operations are at one end

It cannot reuse its memory

All elements are of different data types

Any element can be accessed from it directly<------ans

43. Time taken for addition of element in queue is

(1)

(n)

(log n)<------ans
None of these options

44. When is linear queue said to be empty ? Front==rear

Front=rear-1

Front=rear+1

Front=rear<------ans

45. When queues are created

Are initially empty<------ans

Are initialized to zero

Are considered full

None of the above

46. What would be the output of the following program?

#include <stdio.h>

main()

printf("\n%c", "abcdefgh"[4]);

abcdefgh

e <------ans

error
47. Select the correct C code which will read a line of characters(terminated by a \n) from input_file into a
character array called buffer. NULL terminate the buffer upon reading a \n.

int ch, loop = 0; ch = fgetc( input_file ); while( (ch != `\n`)&& (ch != EOF) ){buffer[loop] = ch; loop++; ch =
fgetc(input_file );} buffer[loop] = NULL;

int ch, loop = 0; ch = fgetc( input_file ); while( (ch = "\n")&& (ch = EOF)) { buffer[loop] = ch; loop--; ch =
fgetc(]input_file ); } buffer[loop]= NULL;

int ch, loop = 0; ch = fgetc( input_file ); while( (ch <> "\n")&& (ch != EOF) ) { buffer[loop] = ch; loop++; ch =
fgetc(input_file ); } buffer[loop] = -1;

None of the above

48. What is the output of the following code ?

void main()

int a=0;

int b=0;

++a == 0 || ++b == 11;

printf("\n%d,%d",a,b);

0, 1

1, 1 <------ans

0, 0

1, 0
49. What is the output of the following program? #define str(x)#x

#define Xstr(x)str(x)

#define oper multiply

void main()

char *opername=Xstr(oper);

printf("%s",opername);

opername

Xstr

multiply <------ans

Xstr

50. What is the output of the following code ? #include<stdio.h>

#include<string.h>

void main()

char *a = "C-DAC\0\0ACTS\0\n"; printf("%s\n",a); }

C-DAC ACTS

ACTS

C-DAC <------ans

None of these
51. #include<stdio.h>

void main()

while (1)

{if (printf("%d",printf("%d")))

break;

else

continue;

The output is

Compile time error

Goes into an infinite loop

Garbage values <------ans

None of these options

52. Select the correct C statements which tests to see if input_file has opened the data file successfully.If not,
print an error message and exit the program.

if( input_file == NULL ) { printf("Unable to open file.\n");exit(1); }

if( input_file != NULL ) { printf("Unable to open file.\n");exit(1); }

while( input_file = NULL ) { printf("Unable to open file.\n");exit(1);}

None of these options


53.The code

int i = 7;

printf("%d\n", i++ * i++);

prints 49

prints 56 <------ans

is compiler dependent

expression i++ * i++ is undefined

54. Recursive procedure are implemented by

Linear list

Queue

Tree

Stack<------ans

55. Which of these are reasons for using pointers?

1. To manipulate parts of an array

2. To refer to keywords such as for and if

3. To return more than one value from a function 4. To refer to particular programs more conveniently

1 & 3<------ans

only 1

only 3

None of these options

56. The expression x = 4 + 2 % -8 evaluates to -6


6

None of these options

57. What is the output of the following code? #include<stdio.h>

main()

register int a=2;

printf("\nAddress of a = %d,", &a); printf("\tValue of a = %d",a);

Address of a,2 <------ans

Linker error

Compile time error

None of these options

58. What is the output of the following code? #include<stdio.h>

void main()

int arr[]={0,1,2,3,4,5,6};

int i,*ptr;

for(ptr=arr+4,i =0; i<=4; i++) printf("\n%d",ptr[-i]);(as the 0=4,for -1 it becomes =3)

Error

65432
0 garbage garbage garbage garbage

4 3 2 1 0 <------ans

59. Which of the following is the correct way of declaring a float pointer:

float ptr;

float *ptr; <------ans

*float ptr;

None of the above

60.If the following program (newprog) is run from the command line as:newprog 1 2 3 What would be the
output of the following?

void main (int argc, char*argv[])

int I,j=0;

for (I=0;I<argc;I++)

j=j + atoi(argv[I]);

printf("%d",j);

123

123

Compilation error<------ans

Вам также может понравиться