MALLA REDDY UNIVERSITY
SCHOOL OF ALLIED AND HEALTHCARE SCIENCES
Basics of C Programming & MS Office
QUESTION BANK
Unit-1:
1. Definition of Computer? Explain Components (or) Block diagram of Computer?
2. Explain about I/O devices and Characteristics of Computer?
3. What is RAM and ROM? Explain different types of RAM and ROM?
4. Difference between System Software and Application Software?
5. Write short notes on i) Application Software (ii) System Software (iii) Data (iv) Information.
6. Explain Different Computer Languages? Explain GB their Conversions?
7. Discuss about the Number System and its Types along with examples?
i) Convert Decimal to Binary (1024) 10= ( ) 2
ii) Convert Binary to Decimal (111001) 2= ( ) 10
8. What are the steps in creating and running C program?
9. Explain about software development methods in programming languages?
10. Explain about Flow Charts and Algorithms?
Unit-2:
1. What is a Variable, Characteristics & Write classification of variables in C?
A variable is a name of the memory location. It is used to store data. Its value can be changed, and it
can be reused many times.
• int - stores integers (whole numbers), without decimals, such as 123 or -123[-
• float - stores floating point numbers, with decimals, such as 19.99 or -19.99
• char - stores single characters, such as 'a' or 'B'. Char values are surrounded by single quotes
• int a=10,b=20;//declaring 2 variable of integer type
• float f=20.8;
• char c='A';
Classification of Variables in C:
The variables can be of the following basic types, based on the name and the type of the variable:
· Global Variable: A variable that gets declared outside a block or a function is known as a global
variable.
Example : int value=30; // a global variable
void function1() {
int a=20;
}
· Local Variable: A local variable is a type of variable that we declare inside a block or a function.
Example: void function1() {
int x=10; // a local variable
}
Features of C Language (OR) Characteristics of C language:
C is the widely used language. It provides many features that are given below.
1.Simple
2.Machine Independent or Portable
3.Mid-level programming language
4.structured programming language
5.Rich Library
6.Memory Management
7.Fast Speed
8.Pointers
9.Recursion
10.Extensible
1) Simple:
C is a simple language in the sense that it provides a structured approach (to break the problem into
parts), the rich set of library functions, data types, etc.
2) Machine Independent or Portable:
Unlike assembly language, c programs can be executed on different machines with some machine
specific changes. Therefore, C is a machine independent language.
3) Mid-level programming language:
Although, C is intended to do low-level programming. It is used to develop system applications such
as kernel, driver, etc. It also supports the features of a high-level language.
4) Structured programming language:
C is a structured programming language in the sense that we can break the program into parts
using functions. So, it is easy to understand and modify. Functions also provide code reusability.
5) Rich Library:
C provides a lot of inbuilt functions that make the development fast.
6) Memory Management:
It supports the feature of dynamic memory allocation. In C language, we can free the allocated
memory at any time by calling the free() function.
7) Speed:
The compilation and execution time of C language is fast since there are lesser inbuilt functions and
hence the lesser overhead.
8) Pointer:
C provides the feature of pointers. We can directly interact with the memory by using the pointers.
We can use pointers for memory, structures, functions, array, etc.
9) Recursion:
In C, we can call the function within the function. It provides code reusability for every function.
Recursion enables us to use the approach of backtracking.
10) Extensible:
C language is extensible because it can easily adopt new features
2. Write about structure of C- program and Explain C basic program?
Structure of C programming is:
1. Documentation Section
2. Link/file inclusion Section
3. Definition Section
4. Global Declaration Section
5. main() function Section
6. Subprogram Section
The basic C Program has this basic variables:
· Global Variable: A variable that gets declared outside a block or a function is known as a global
variable.
Example : int value=30; // a global variable
void function1() {
int a=20;
}
· Local Variable: A local variable is a type of variable that we declare inside a block or a function.
Example: void function1() {
int x=10; // a local variable
3. Explain the following in C language:
(a) Keywords (b) Data Types (c) Constants (d) Tokens
DATA TYPES:
A data type specifies the type of data that a variable can store such as integer, floating,
character, etc.
Example of Data Types in C:
Let’s consider a scenario of a company. A company stores various data of their employee such as
Name, Employee ID, Age, Salary, Address, Phone No, etc.
Now, these data are values containing alphabets, numbers, etc, so to make the processing of these
huge data for programs easy, the information was categorized into different types:
Name: String
ID: Integer
Salary: Float or Double
Phone No: String
Tokens in C
A token in C can be defined as the smallest individual element of the C programming language that
is meaningful to the compiler. It is the basic component of a C program.
.
Keywords
The keywords are pre-defined or reserved words in a programming language. Each keyword is meant
to perform a specific function in a program.
• examples of keywords are: double, int, auto, char, break, and more.
Identifiers:
These are used to name the arrays, functions, structures, variables, etc. The identifiers are user-defined words
in the C language
Constants:
A constant is a value or variable that can't be changed in the program, for example: 10,
20, 'a', 3.4, "c programming" etc
Strings:
Strings are nothing but an array of characters ended with a null character (‘\0’).
Examples of String:
char string[20] = {‘g’, ’e’, ‘e’, ‘k’, ‘s’, ‘f’, ‘o’, ‘r’, ‘g’, ’e’, ‘e’, ‘k’, ‘s’, ‘\0’};
char string[20] = “geeksforgeeks”;
char string [] = “geeksforgeeks”;
Special Symbols:
[] () {} , : ; * = # . ~
Operators
Arithmetic operators: (+, -, *, %).
Relational Operators :(=, !=, <, >, <= ,>=).
Logical Operators :(&&(AND), OR(||)).
Assignment Operators :(=, -=, +=).
Bitwise Operator :(P&Q(AND), XOR(P/Q), SHIFT RIGHT(P>>2)).
4. Explain the following:
(a) Arithmetic Operators
These operators are used for numerical calculations (or) to perform arithmetic operations like
addition, subtraction etc.
(b) Relational Operators
These are used for comparing two expressions
(c) Logical Operators
These are used to combine 2 (or) more expressions logically.
(d) Assignment Operators
It assigns a value to a variable. The types of assignment operators are
Simple assignment.
Compound assignment
(e) Increment & Decrement Operators
This operator increments the value of a variable by 1
It is used to decrement the values of a variable by 1
(f) Bitwise Operators
Bitwise operators operate on bits
5. Write about various operators & expressions in C language?
operators and expressions used in C language:
Operator performs an operation on data. They are classified into following −
1. Arithmetic operators: (+, -, *, %).
2. Relational Operators :(=, !=, <, >, <= ,>=).
3. Logical Operators :(&&(AND), OR(||)).
4. Assignment Operators :(=, -=, +=).
5. Bitwise Operator :(P&Q(AND), XOR(P/Q), SHIFT RIGHT(P>>2)).
6. Increment & Decrement Operator: (++,--)
Unit-3:
1. What are control statements explain a few Examples?
Control Statements:
The control statements help users specify the order of execution of the instructions present in a
program.
2. Explain the following control statements?
(a) if statements
The if statement is used to check some given condition and perform some operations
depending upon the correctness of that condition.
The syntax of the if statement is given below.
if(expression)
{
//code to be executed
}
(b) switch statements
The switch statement in C language is a decision control statement that is typically used when the
user must choose between multiple alternatives.
Syntax:
switch (expression)
{
case x: // code block
break;
case y: // code block
break; 3
default:
// code block
}
(c) goto statements
goto statement does not require any condition. This statement passes control anywhere in the
program .
i.e., control is transferred to another part of the program without testing any condition.
Syntax :
goto label
.....
.....
label:
statements;
(d) loop statements.
Suppose that you have to print table of 2, then you need to write 10 lines of code. By using the loop
statement, you can do it by 2 or 3 lines of code only.
3. What is an array in C with example?
Array:- An array is defined as an ordered set of similar data items.
All the data items of an array are stored in consecutive memory locations in RAM.
The elements of an array are of same data type and each item can be accessed using the same name.
Eg: One dimensional array, Two dimensional array & Multi dimensional array
Syntax:-
data_type array_name[n];
where, n is the number of data items (or) index(or) dimension.
0 to (n-1) is the range of array.
Ex: int a[5]; float x[10];
4. How to creating an array step by steps?
all the variables are declared before they are used in the program. Similarly, an array must be
declared before it is used.
During declaration, the size of the array has to be specified.
The size used during declaration of the array informs the compiler to allocate and reserve the
specified memory locations
5. Explain types of arrays?
2D arrays:
An array consisting of two subscripts is known as two-dimensional array.
These are often known as array of the array. In two dimensional arrays the array is divided into rows and
columns
:- Syntax: data_type array_name[row_size][column_size];
Ex:- int arr[3][3];
multi-dimensional arrays:
Multidimensional arrays are often known as array of the arrays.
In multidimensional arrays the array is divided into rows and columns, mainly while
considering multidimensional arrays we will be discussing mainly about two dimensional
arrays and a bit about three dimensional arrays.
Syntax: data_type array_name[size1][size2][size3] ----- [sizeN];
Unit-4:
1) Write Down Uses of MS-WORD? Create and Write the Steps for Creating Time-Table?
Table:
A table is a grid of cells arranged in rows and columns. Tables can be used to organize any
type of content, whether you're working with text or numerical data.
INSERT TABLES IN A DOCUMENT:
For a basic table, click Insert > Table and move the cursor over the grid until you highlight the
number of columns and rows you want. For a larger table, or to customize a table, select Insert >
Table > Insert Table. Tips: If you already have text separated by tabs, you can quickly convert it to a
table.
Advantage of Tables in word:
Tables can be used to organize any type of content, whether you're working with text or
numerical data.
In Word, you can quickly insert a blank table or convert existing text to a table.
You can also customize your table using different styles and layouts.
2) Using MS-WORD Explain The Following?
(i) Different Font Sizes
(ii) Bold
(iii) Italic
(iv) Bullets
(v) Numbers
(vi) Pictures
(vii) choosing paper sizes.
3) Using MS-WORD:
(i) Adjusting Margins (ii) Header and Footer (iii) Inserting Page No’s
(iv)Spell Check and Grammar (v) Find and Replace
4) Creating and Write the Steps for Mail Merge & how to send a letter to 5-6 Numbers using
Mail merge?
5) a)What is Table? Mention the advantages of using table in MS-Word?
b) What are various alignments and Text Formatting in MS-Word?
Unit-5:
1 . How do you creating and editing worksheets in MS Excel? Uses of MS Excel?
2. What are Excel formulas and functions with examples?
3. Write differences among COUNT, COUNTA, COUNTIF and COUNTBLANK in MS Excel
with Examples?
4. What are examples of manipulating data with excel? Using sort functions, Numbers & alphabets? 5. How to
make Charts and Graphs using data in Excel? Also inserting data from other worksheets?
6. (a) Explain Transitions in PowerPoint? What are the different slide transition options?
(b) How to create animations in Microsoft PowerPoint?
7. How to Insert Clip Art, Pictures, Tables and graphs in PowerPoint?
8. How to insert a slide numbers, date and sound file into a PowerPoint presentation?