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

Answer Sheet Template: Part - A (One Exercise) Ans. 1: C Code For Exercise 1 - Symbol Table Creation (35 Marks)

This document contains an answer sheet template for a C programming exam. Part A contains the full C code for an exercise on symbol table creation using arrays. Part B contains 5 questions on computer science topics like assemblers, CISC machines, flag registers, loaders, and linkers.

Uploaded by

Shubham Tiwari
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)
63 views4 pages

Answer Sheet Template: Part - A (One Exercise) Ans. 1: C Code For Exercise 1 - Symbol Table Creation (35 Marks)

This document contains an answer sheet template for a C programming exam. Part A contains the full C code for an exercise on symbol table creation using arrays. Part B contains 5 questions on computer science topics like assemblers, CISC machines, flag registers, loaders, and linkers.

Uploaded by

Shubham Tiwari
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/ 4

Answer Sheet Template

Part – A (One exercise)

Ans. 1: C code for Exercise 1 –Symbol Table Creation [35 marks]


#include<iostream.h>

#include<conio.h>

#include<stdlib.h>

#define SIZE 5;

int arr[SIZE], front=0, rear=0;

void main()

clrscr();

void insert();

void delete();

void display();

int a;

cout<<"menu\n";

cout<<"1. Insert\n";

cout<"2. Delete\n";

cout<<"3. Dispaly\n";

cout<<"4. Exit\n";

cin>>a;

switch(a)

case 1: insert();

break;

case 2: delete();

break;

case 3: display();
break;

case 4: exit(0);

default:

cout<<"\n Invalid input";

void insert()

int a;

if(rear==SIZE && front==0)

cout<<"array is full"';

else

cout<<"enter the number";

cin>>a;

arr[rear]=a;

rear++;

void delete()

int a;

if(front==rear)

cout<<"Array is empty";

else

a=arr[front];

front++;

cout<<"\n"<<a<<" -removed from the array\n";

}
}

void display()

int a, tmp=front;

if(front==rear)

cout<<"the array is empty\n";

else

cout<<"\n elements in the array:";

for(a=tmp;a<rear;a++)

cout<<arr[a]<<" ";

Part – B (Five questions)

1. What is assembler?
An assembler is a type of computer program that interprets software programs written in
assembly language into machine language, code and instructions that can be executed by a
computer. An assembler enables software and application developers to access, operate and
manage a computer's hardware architecture and components. An assembler is sometimes
referred to as the compiler of assembly language. It also provides the services of an
interpreter
2. What is CISC machine?
CISC was developed to make compiler development easier and simpler. The full form of CISC
is Complex Instruction Set Computer. They are chips that are easy to program that makes
efficient use of memory. CISC eliminates the need for generating machine instructions to the
processor. For example, instead of having to make a compiler, write lengthy machine
instructions to calculate a square-root distance, a CISC processor offers a built-in ability to do
this. Many of the early computing machines were programmed in assembly language.
Computer memory was slow and expensive. CISC was commonly implemented in such large
computers, such as the PDP-11 and the DEC system.
3. What is the use of Flag register in microprocessor?
The Flag or Status register is a 16-bit register which contains 9 flags, and the remaining 7 bits
are idle in this register. These flags tell about the status of the processor after any arithmetic
or logical operation. IF the flag value is 1, the flag is set, and if it is 0, it is said to be reset.
4. What is loader?
A loader is a major component of an operating system that ensures all necessary programs
and libraries are loaded, which is essential during the startup phase of running a program. It
places the libraries and programs into the main memory in order to prepare them for
execution. Loading involves reading the contents of the executable file that contains the
instructions of the program and then doing other preparatory tasks that are required in
order to prepare the executable for running, all of which takes anywhere from a few seconds
to minutes depending on the size of the program that needs to run.
5. What is a linker?
In computer science, a linker is a computer program that takes one or more object files
generated by a compiler and combines them into one, executable program. Computer
programs are usually made up of multiple modules that span separate object files, each
being a compiled computer program. The program as a whole refers to these separately
compiled object files using symbols. The linker combines these separate files into a single,
unified program, resolving the symbolic references as it goes along.
Dynamic linking is a similar process available on many operating systems, which postpones
the resolution of some symbols until the program is executed. When the program is run,
these dynamic link libraries are loaded, as well. Dynamic linking does not require a linker.

You might also like