Q Explain loading and linking of a program in detail. 7.
5 marks 2015 – 16
Q Describe compiler , interpreter , assembler? Write the names of compiler that are used in C
programming.
7 marks 2017 – 18
Q Discuss the concept of assembler. Explain compiler , interpreter , loader and linker with example.
10 marks 2018 – 19
Q- What is token in ‘C’ language ? 2 marks 2017 – 18
Q - Discuss various primitive data types used in C with suitable examples including their required
memory size, format specifier and range.
7 marks 2022 – 23
Q- Differentiate between void and int datatypes. 2 marks 2021 – 22
Sujeet Gupta ( Programming EXPERT since 2005 )
Contact - 9598979977 , 9935430895 , 7678172453
E-mail - [Link]@[Link]
Q What are the escape sequences characters? 2 marks 2015 – 16
Answer -
Escape Meaning ASCII purpose
Sequence Value
\b backspace 008 Moves the cursor to the previous position of the current line
\a bell(alert) 007 Produces a beep sound for alert
\r carriage return 013 Moves the cursor to beginning of the current line.
\n newline 010 Moves the cursor to the beginning of the next line.
\f form feed 012 Moves the cursor to the initial position of the next logical page.
\0 null 000 Null
\v vertical tab 011 Moves the cursor to next vertical tab position
\t Horizontal tab 009 Moves the cursor to the next horizontal tab position.
\\ backslash 092 Presents a character with backslash ( \ )
Q What do mean by software. 2 marks 2015 – 16
Answer -
Software is a collection of programs and a program is a collection of instructions given to the computer.
Development of software is a stepwise process. Before developing a software, number of processes are
done. The first step is to understand the user requirements. Problem analysis arises during the
requirement phase of software development. Problem analysis is done for obtaining the user
requirements and to determine the input and output of the program.
For solving the problem, an "algorithm" is implemented. Algorithm is a sequence of steps that gives
method of solving a problem. This "algoritnm" creates the logic of program. On the basis of this
“algorithm", program code is written. The steps before writing program code are as
Process of program development are
1 User requirements
2 Problem analysis
3 Input and Output
4 Designing algorithm
5 Program coding
Sujeet Gupta ( Programming EXPERT since 2005 )
Contact - 9598979977 , 9935430895 , 7678172453
E-mail - [Link]@[Link]
Q Define the concept of top down development and stepwise refinement process.
2 marks 2016 – 17
Q Write short notes on
(a) Top down program development approach
(b) Differentiate structure and array
7 marks 2017 – 18
Answer
Design Methods :
Designing is the first step for obtaining solution of a given problem. The purpose of designing is to
represent the solution for the system. It is really difficult to design a large system because the
complexity system cannot be represented easily. So various methods have been evolved for designing. .
Top-Down Design
Every system has several hierarchies of components. The top-level component represents the whole
system. Top-Down design method starts from top-level component to lowest level (bottom) component.
In this design method, the system is divided into some major components.
Then each major component is divided into lower level components. Similarly other components are
divided till the lowest level component.
Q What is meant by modular programming approach? 2 marks 2016 – 17
Answer
It is better to divide a large system into modules. In terms of programming, module is logically a well
defined part of program. Each module is a separate part of the program. It is easy to modify a program
written with modular approach because changes in one module don't affect other modules of program.
It is also easy to check bugs in the program in module level programming
Q Why C programming is called structured programming 2 marks 2015 – 16
Q What is structured programming approach? 2 marks 2016 – 17
Q Write a short note on structured programming 2 marks 2015 – 16
Sujeet Gupta ( Programming EXPERT since 2005 )
Contact - 9598979977 , 9935430895 , 7678172453
E-mail - [Link]@[Link]
Answer –
C contains control constructs needed to write a structured program hence it is considered a structured
programming language. It includes structures for selection (if...else, switch), repetition (while, for ,
do...while) and for loop exit (break)
C is called a structured programming language because to solve a large problem, C
programming language divides the problem into smaller structural blocks each of which handles
a particular responsibility. Structured programming is a programming approach that focuses on
enhancing the clarity, quality, and efficiency of computer programs. It achieves this goal by
heavily relying on structured control flow constructs, such as selection (if/then/else) and
repetition (while and for) statements, along with block structures and subroutines. Structured or
structural programming is often synonymed with few other programming paradigm
like Procedural Programming and Modular Programming.
Different Structural blocks
Sequence
Selection
Iteration
Subroutines or Functions
Single Entry and Exit Points
Q Draw the Pyramid structure of memory hierarchy 2 marks 2021 – 22
Answer
Sujeet Gupta ( Programming EXPERT since 2005 )
Contact - 9598979977 , 9935430895 , 7678172453
E-mail - [Link]@[Link]
Q - Differentiate between RAM and ROM. 2 marks 2015 – 16
Difference Between RAM and ROM
Difference Random Access Memory (RAM) Read Only Memory (ROM)
RAM is a volatile memory that
Data- ROM is a non-volatile memory that can retain
could store the data as long as
Retention the data even when the power is turned off.
the power is supplied.
Read and write operations are
Read/Write Only read operations are supported.
supported.
It is typically used to store firmware or
Used to store the data that has
microcode, which is used to initialize and
Use to be currently processed by CPU
control hardware components of the
temporarily.
computer.
Speed It is a high-speed memory. It is much slower than the RAM.
CPU CPU can easily access data stored
CPU cannot easily access data stored in ROM.
Interaction in RAM.
Size and Large size with higher capacity,
Small size with less capacity, concerning RAM.
Capacity concerning ROM.
Used as/in CPU Cache , Primary memory. Firmware, Micro-controllers.
The data stored is easily The data stored is not as easily accessible as in
Accessibility
accessible. the concerning RAM.
Cost RAM is more costlier than ROM. ROM is cheaper than RAM.
A RAM chip can store only a few A ROM chip can store multiple megabytes
Chip Size
gigabytes (GB) of data. (MB) of data.
Used for the temporary storage
Used to store firmware, BIOS, and other data
Function of data currently being
that needs to be retained.
processed by the CPU.
Sujeet Gupta ( Programming EXPERT since 2005 )
Contact - 9598979977 , 9935430895 , 7678172453
E-mail - [Link]@[Link]
Q What is enumerated data type? 2 marks 2015 – 16
Q What are the enumerated data types ? Explain in detail.
10 marks 2015 – 16
Answer
An eumeration type is a user defined data type, which can take values only from a user defined list of
named integer constants called enumerators. The syntax of defining an enumeration data type is same
as that of structure or union. The general format of definition is-
enum tag
{
member 1;
member2;
…………
};
Here enum is a keyword, tag is an identifier that specifies the name of the new enumeration type being
defined, and member 1, member2 are identifiers which represent integer constants and are called
enumerator constants or enumerators. The list of these enumerators is called enumerator list. Note that
unlike structure and union, here the members inside the braces are not variables, they are named
integer constants.
After the definition, we can declare variables of this new data type as
enum tag var1, var2, var3;
Here var1, var2, var3 are variables of type enum tag. These variables can take values only from the
enumerator list.
The variables can also be declared with the definition as
enum tag
{
Member1;
member2 ;
}var1, var2, var3;
here tag is optional. Let us take an example
Sujeet Gupta ( Programming EXPERT since 2005 )
Contact - 9598979977 , 9935430895 , 7678172453
E-mail - [Link]@[Link]
emum month{ Jan, Feb, Mar, Apr, May, Jun } ;
Here a new data type month is defined and the enumerator list contains six enumerators. Internally the
compiler treats these enumerators as integer constants. These are automatically assigned integer values
beginning from 0, 1,2... etc till the last member of the enumeration. In the above example these
enumerators will take following values
Jan 0
Feb 1
Mar 2
Apr 3
May 4
Jun 5
These are the default values assigned to the enumerators. It is also possible to explicitly assign any value
to enumerators but in this case, the successive unassigned enumerators will take values one greater
than the value of the previous enumerator. For example
enum month{ Jan, Feb = 4, Mar, Apr, May = 11, Jun };
Now the enumerators will take following values .
Jan 0
Feb 4
Mar 5
Apr 6
May 11
Jun 12
We can assign any signed integer value to enumerators, provided the value is within the range. It is also
possible to assign same value to more than one enumerator.
enum month{ Jan, January = 0, Feb = 1, February = 1, Mar = 2, March = 2};
Sujeet Gupta ( Programming EXPERT since 2005 )
Contact - 9598979977 , 9935430895 , 7678172453
E-mail - [Link]@[Link]
The enumerated variables can be processed like other integer variables. We can assign values to them
from the enumerator list or they can be compared to other variables and values of the same type.
example
enum month{ Jan, Feb, Mar, Apr, May, Jun } m1, m2;
m1= Mar;
m2 = May;
Now m1 has integer value 2 and m2 will take the value 4.
Any variable of type enum month can take values only from the 6 enumerators specified in the list. For
example this is invalid
M1 = Dec; /*Invalid*
/* Program to print the value of enum variables*/
#include<stdio.h>
void main( )
{
enum month{Jan,Feb,Mar,Apr,May,Jun}m1,m2;
m1=Mar;
printf("m1 = %d \n",m1);
printf ("Enter value for m2 ") ;
scanf ("%d" ,&m2) ;
printf("m1 = %d \n",m2);
Output :
m1 = 2
Enter the value for m2 : 5
m2 = 5
Q Write is the role of ALU? Explain. 2 marks 2015 – 16
Answer
Sujeet Gupta ( Programming EXPERT since 2005 )
Contact - 9598979977 , 9935430895 , 7678172453
E-mail - [Link]@[Link]
ALU is a digital circuit that provides
The ALU is the mathematical brain of a computer.
arithmetic and logic operations. It is the fundamental building block of the central
processing unit of a computer. A modern central processing unit(CPU) has a very
powerful ALU and it is complex in design. In addition to ALU modern CPU contains
a control unit and a set of registers. Most of the operations are performed by one or
more ALUs, which load data from the input register. Registers are a small amount of
storage available to the CPU. These registers can be accessed very fast.
The control unit tells ALU what operation to perform on the available data. After
calculation/manipulation, the ALU stores the output in an output register.
An Arithmetic Logic Unit (ALU) is a key component of the CPU responsible for
performing arithmetic and logical operations. The collection of functional units like
ALUs, registers, and buses that move data within the processor. together are known
as Data Path, they execute instructions and manipulate data during processing
tasks.
Q Write about the formatted and unformatted Input / Output functions in C.
10 marks 2015 – 16
Q What do you mean by formatted output in C language ? Explain with example ?
2 marks 2017 – 18
Q Write the use of putchar() and getchar().
2 marks 2017 – 18
Answer
The screen and keyboard together are called a console. Console I/O functions can be further classified into two
categories— formatted and unformatted console I/O functions. The basic difference between them is that the
formatted functions allow the input read from the keyboard or the output displayed on the VDU to be formatted
as per our requirements. For example, if values of average marks and percentage marks are to be displayed on the
screen, then the details like where this output would appear on the screen, how many spaces would be present
Sujeet Gupta ( Programming EXPERT since 2005 )
Contact - 9598979977 , 9935430895 , 7678172453
E-mail - [Link]@[Link]
between the two values, the number of places after the decimal points, etc. can be controlled using formatted
functions.
Formatted Console I/O Functions
printf() function
Syntax - printf ( "format string", list of variables ) ;
The format string can contain:
(a) Characters that are simply printed as they are
(b) Conversion specifications that begin with a % sign
(c) Escape sequences that begin with a \ sign
For example, look at the following program:
void main( )
int avg = 346 ;
float per = 69.2 ;
printf ( "Average = %d\nPercentage = %f", avg, per ) ;
Sujeet Gupta ( Programming EXPERT since 2005 )
Contact - 9598979977 , 9935430895 , 7678172453
E-mail - [Link]@[Link]
We can provide following optional specifiers in the format specifications.
int weight = 63 ;
printf ( "\nweight is %d kg", weight ) ;
printf ( "\nweight is %2d kg", weight ) ;
printf ( "\nweight is %4d kg", weight ) ;
printf ( "\nweight is %6d kg", weight ) ;
printf ( "\nweight is %-6d kg", weight ) ;
main( )
Sujeet Gupta ( Programming EXPERT since 2005 )
Contact - 9598979977 , 9935430895 , 7678172453
E-mail - [Link]@[Link]
{
printf ( "\n%10.1f %10.1f %10.1f", 5.0, 13.5, 133.9 ) ;
printf ( "\n%10.1f %10.1f %10.1f", 305.0, 1200.9, 3005.3 );
This results into a much better output...
format specifiers could be used even while displaying a string of characters.
/* Formatting strings with printf( ) */
main( )
char firstname1[ ] = "Sandy" ;
char surname1[ ] = "Malya" ;
char firstname2[ ] = "AjayKumar" ;
char surname2[ ] = "Gurubaxani" ;
printf ( "\n%20s%20s", firstname1, surname1 ) ;
printf ( "\n%20s%20s", firstname2, surname2 ) ;
Sujeet Gupta ( Programming EXPERT since 2005 )
Contact - 9598979977 , 9935430895 , 7678172453
E-mail - [Link]@[Link]
scanf() function
syntax : scanf ( "format string", list of addresses of variables ) ;
For example: scanf ( "%d %f %c", &c, &a, &ch ) ;
sprintf( ) and sscanf( ) Functions
sprintf( ) writes the output to an array of characters
void main()
int i = 10 ;
char ch = 'A' ;
float a = 3.14 ;
char str[20] ;
printf ( "\n%d %c %f", i, ch, a ) ;
sprintf ( str, "%d %c %f", i, ch, a ) ;
printf ( "\n%s", str ) ;
sscanf( ) - to read characters from a string and to convert and store them in C variables according to specified
formats.
Unformatted Console I/O Functions
getch() return the character that has been most recently typed , without echoing it on the screen
getche( ) return the character that has been most recently typed , echoes (displays) the character that you
typed to the screen.
getchar( ) macro , echo’s the character that you typed on the screen, but unfortunately requires Enter key to
be typed following the character that you typed
fgetchar( ) function , will echo character, must be followed by enter key
putch( ) print only one character on the screen at a time
putchar( ) print only one character on the screen at a time
fputchar( ) print only one character on the screen at a time
main()
Sujeet Gupta ( Programming EXPERT since 2005 )
Contact - 9598979977 , 9935430895 , 7678172453
E-mail - [Link]@[Link]
{
char ch ;
printf ( "\nPress any key to continue" ) ;
getch( ) ; /* will not echo the character */
printf ( "\nType any character" ) ;
ch = getche( ) ; /* will echo the character typed */
printf ( "\nType any character" ) ;
getchar( ) ; /* will echo character, must be followed by enter key */
printf ( "\nContinue Y/N" ) ;
fgetchar( ) ; /* will echo character, must be followed by enter key */
void main( )
char ch = 'A' ;
putch ( ch ) ;
putchar ( ch ) ;
fputchar ( ch ) ;
putch ( 'Z' ) ;
putchar ( 'Z' ) ;
fputchar ( 'Z' ) ;
And here is the output...
AAAZZZ
gets( ) receives a multi word string from the keyboard
puts( ) outputs a multi word string to the screen
main( )
char arr[40] ;
Sujeet Gupta ( Programming EXPERT since 2005 )
Contact - 9598979977 , 9935430895 , 7678172453
E-mail - [Link]@[Link]
puts ( "Enter name" ) ;
gets ( arr ) ; /* sends base address of array */
puts ( arr ) ;
Q What is digital computer? Also explain block diagram of digital computer in detail.
10 marks 2016 – 17
Q Draw the architecture of Digital computer System and explain its all components.
10 marks 2021 – 22
Q Draw the block diagram of a computer system. Explain its different components
with suitable example.
2 marks 2018 -19
Answer
A digital computer is a system that processes data and instructions using binary codes (0s and 1s) at
high speed, performing functions like input, storage, control, processing, and output.
The functional components of a digital computer include the Input Unit, which
takes in data; the CPU, which processes data with its Control Unit
(CU), Arithmetic Logic Unit (ALU), and Registers; the Memory Unit, which stores
data temporarily (RAM) or permanently (HDD/SSD); the Output Unit, which
displays results; and the Bus System, which connects and transfers data between
components. These parts work together to execute tasks and provide results.
Sujeet Gupta ( Programming EXPERT since 2005 )
Contact - 9598979977 , 9935430895 , 7678172453
E-mail - [Link]@[Link]
The functional components of a computer are the key parts that work
together to process and manage data. These include the Input Unit for receiving
data, the CPU for processing it, the Memory Unit for storing information,
the Output Unit for displaying results, and the Bus System that connects all parts.
These components help the computer perform tasks efficiently.
1. Input Unit
Purpose: Captures data and instructions from users or external sources.
Function: Converts user input into binary signals that the computer can process.
Common Devices (2025):
o Keyboard, Mouse, Touchscreens
o Scanners, Sensors, Stylus pens
o Voice Assistants (e.g., Siri, Alexa)
o Biometric devices (face/fingerprint recognition)
o Iot-based inputs from smart devices
2. Central Processing Unit (CPU) – The Brain of the Computer
The CPU executes instructions and controls all internal operations. In 2025, CPUs
will often have multiple cores and threads to handle parallel processing efficiently.
Components of CPU:
a. Arithmetic Logic Unit (ALU)
Performs arithmetic operations (add, subtract, multiply, divide).
Handles logical operations (comparison, decision-making).
Supports AI/ML tasks using built-in vector/matrix operations (in modern CPUs).
Sujeet Gupta ( Programming EXPERT since 2005 )
Contact - 9598979977 , 9935430895 , 7678172453
E-mail - [Link]@[Link]
b. Control Unit (CU)
Directs the operations of all computer parts.
Decodes instructions and coordinates data flow.
Sends control signals to memory and I/O devices.
c. Registers
High-speed memory locations within the CPU.
Temporarily store instructions, addresses, and intermediate data.
Examples: Accumulator, Instruction Register, Program Counter, Address
Register.
Modern CPUs include 64-bit or even 128-bit registers for faster processing.
3. Memory / Storage Unit
The memory unit holds data and instructions before, during, and after processing.
a. Primary Memory (Main Memory):
RAM (Random Access Memory): Temporarily stores data during execution.
o Types in 2025: DDR5, LPDDR5X, and emerging MRAM.
ROM (Read-Only Memory): Stores boot-up instructions and firmware.
Cache Memory: Ultra-fast memory between CPU and RAM (L1, L2, L3 levels).
b. Secondary Storage:
Used for long-term data storage.
Examples: SSDs (NVMe drives), HDDs, flash drives, and cloud storage.
Modern Trend: Use of Cloud Integration and hybrid storage models.
4. Output Unit
Purpose: Converts processed data (binary) into a form users can understand.
Examples:
o Visual: Monitors (LED, OLED, 4K/8K displays)
o Print: Printers (Inkjet, Laser, 3D Printers)
o Audio: Speakers, Headphones
o Haptic: Vibration feedback devices
Emerging Tech: AR/VR headsets, voice-based output, Braille displays for
accessibility
Interconnection between Functional Components
A computer consists of an input unit that takes input, a CPU that processes the
input and an output unit that produces output. All these devices communicate with
each other through a common bus. A bus is a transmission path, made of a set of
conducting wires over which data or information in the form of electric signals is
passed from one component to another in a computer. The bus can be of three
types – Address bus, Data bus and Control Bus.
The following figure shows the connection of various functional components:
Sujeet Gupta ( Programming EXPERT since 2005 )
Contact - 9598979977 , 9935430895 , 7678172453
E-mail - [Link]@[Link]
The address bus carries the address location of the data or instruction. The data
bus carries data from one component to another, and the control bus carries the
control signals. The system bus is the common communication path that carries
signals to/from the CPU, main memory and input/output devices. The input/output
devices communicate with the system bus through the controller circuit, which helps
in managing various input/output devices attached to the computer.
BEST OF LUCK to all students for PPS AKTU Exam
Sujeet Gupta ( Programming EXPERT since 2005 )
Contact - 9598979977 , 9935430895 , 7678172453
E-mail - [Link]@[Link]