0% found this document useful (0 votes)
45 views19 pages

Unit 1 - Unit 3 QB

Uploaded by

ff17062007
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)
45 views19 pages

Unit 1 - Unit 3 QB

Uploaded by

ff17062007
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/ 19

Page|1

UNIT I

INTRODUCTION

Course Objective – C Ob 1: To understand the concepts of C Language.

Course Outcome – CO1: Develop efficient algorithms for solving a problem.

Bloom’s Taxonomy Level - K1, K2, K3.


PART A

S.No. Question BTL


1. Define programming paradigm. How is it classified? K1
Programming paradigm is a style or way of programming. Programming
paradigm is an approach to solve problem using some programming
language or also we can say it is a method to solve a problem using tools
and techniques that are available to us following some approach.
Classification of programming paradigms:

2. Differentiate imperative and declarative programming paradigms. K2


S.No. Imperative Declarative Programming
Programming
1. In this, programs specify In this, programs specify what
how it is to be done. is to be done.
2. It simply describes the It simply expresses the logic of
control flow of computation.
computation.
3. Its main goal is to Its main goal is to describe the
describe how to get it or desired result without direct
accomplish it. dictation on how to get it.
4. It is classified into It is classified into logic
procedural programming, programming and functional
object-oriented programming and database
programming and processing approach.
Page|2

parallel processing
approach.

5. It gives full control to It may automate repetitive flow


developers that are very along with simplifying code
important in low-level structure.
programming.
3. Define computer and list out the basic operations of a computer. K2
A computer is an electronic
device that can perform
various functions by taking
input from the user,
performing various
processes on it with a set of
defined instructions that
produce an output.
The computer consists of
the following basic units:
 Input unit
 Central Processing
Unit (CPU)
 Output unit
 Memory unit
4. Distinguish between Hardware and Software. K2
S.No. Hardware Software
1. Hardware is the physical aspect o A set of instructions that
computer, telecommunications enables physical
and other devices. components of a computer to
work in a synchronized way.
2. Types: Types:
1.Internal hardware 1.System Software
2.Input Hardware 2.Programming Software
3.Output Hardware 3.Application Software
4.Connecting Hardware 4.Utility Software
5.Storage Hardware
3. Examples: Processor, Memory Examples: Ms Word, Excel,
Devices, Monitor, Printer, PowerPoint, Google
Keyboard, Mouse, and the Chrome, Photoshop,
Central Processing Unit. MySQL, etc.
5. Differentiate the characteristics of primary and secondary storage of a K2
computer system.
● Primary storage is storage that a computer CPU has direct access to,
suchas RAM, ROM, or cache memory. It is very fast, to minimize the
amount of time the CPU has to wait to retrieve information.
● Secondary storage is generally larger, slower, less expensive per
gigabyte,and not directly accessible by the CPU. A hard drive or SSD
fits into this category, as do things like magnetic tape, USB sticks,
DVD or CDs, etc.
Page|3

6. What is an algorithm? List the characteristics of algorithms. K1


An algorithm is a step-by-step procedure used for solving a problem or
performing a computation. Algorithms act as an exact list of instructions
that conduct specified actions step by step in either hardware- or software-
based routines.
Characteristics of algorithms:
 Well-defined inputs and outputs
 Finiteness
 Definiteness
 Effectiveness
 Unambiguity
 Language independence
7. Write an algorithm to find the factorial of a number. K3
Step 1: Start the program.
Step 2: Read an integer ‘n’ to find the factorial.
Step 3: Initialize f as 1 and j as 1.
Step 4: If j <= n, go to Step 5; otherwise go to Step 6.
Step 5: Calculate f = f x j. Increase j by 1. Go to Step 4.
Step 6: Display the value of ‘f’.
Step 7: Stop the program.
8. What is a flowchart? Give few flowchart symbols and their purpose. K2
 A Flowchart is a diagrammatic representation of sequence of logical
steps of a program.
 It shows steps in sequential order and is widely used in presenting the
flow of algorithms, workflow or processes
Symbol Symbol Purpose
Name

Used at the beginning and end of the


Start/Stop algorithm to show start and end of the
program.

Indicates processes like mathematical


Process operations.

Input/ Used for denoting program inputs and


Output outputs.

Stands for decision statements in a


Decision program, where answer is usually Yes
or No.

Shows relationships between different


Arrow shapes.
Page|4

Connects two or more parts of a


On-page
flowchart, which are on the same
Connector
page.

Off-page Connects two parts of a flowchart


Connector which are spread over different pages.

9. Draw a flowchart to find the greater of 2 numbers. K3

10. Write the structure of C program. K1

11. How is #define pre-processor useful? K2


The #define preprocessor directive is used to define a Global constant and
macros.
Eg. #define PI 3.14
#define big(a,b) a>b?a:b
When it reads the constant label, it replaces the label by its value. When a
compiler reads the macro name, it replaces the macro name by its
expansion.
12. List down few applications of C Language. K2
C programming can be used to do a variety of tasks such as:
 Network device
 Operating systems
Page|5

 Language compilers and interpreters


 Designing GUI applications
 Text editors
 Modern programming languages
 Design databases
 Utility software
13. What is a data type? What are variables? K1
A data type is the type of data a variable can hold. For example, a Boolean
variable can have boolean data, and an integer variable can hold integer
data. It is an attribute that tells a computer how to interpret the value.
Variables are just storage locations reserved for storing values.
14. List different datatypes available in C. K1
Data types are used to specify the type of a variable. In c, the data types
are classified into 3 category. They are,
Primary or Built-in : int , char, float, double, void
Derived : function, array, pointer
User defined : structure, union, enum, typedef
15. What is a constant? How are constants declared in C language? K2
A constant is a value or variable that can't be changed or altered in the
program. Examples: 10, 20000, 'a', ’5’ 3.4, "c programming”.
In C language, a constant can be declared and initialised as below:
const int age = 5; const char initial = ‘S’;
16. What is enum in C? K2
An enumeration type or enum is a user defined data type. It is a special
data type that enables for a variable to be a set of predefined constants.
The constants are initialised by default as 0, 1, 2, …If needed, they can
also be initialised by the user.
Eg. 1 enum weekdays {Mon, Tue, Wed, Thu, Fri};
Eg. 2 enum suit { club = 0, diamonds = 10, hearts = 20, spades = 3 };
17. What are keywords? Give few examples. K1
 Keywords are reserved words, they have standard and predefined
meaning.
 Keywords cannot be used as normal identifiers.
 Examples: auto, break, char, continue, else, if, switch, struct, union.
18. What is number system? What are the types of number system? K1
It is a systematic way to represent numbers in different ways. Each number
system has its own base, which represents the number of symbols or digits
used in that number system. The different number systems available are:
 Decimal number system (Base - 10)
 Binary number system (Base - 2)
 Octal number system (Base -8)
 Hexadecimal number system (Base - 16)
19. Give the steps to convert a decimal number into a binary number. K1
1. Divide the decimal number by 2 and store remainders in array.
Page|6

2. Divide the quotient by 2.


3. Repeat step 2 until we get the quotient equal to zero.
4. Equivalent binary number would be reverse of all remainders of step 1.
20. Convert (16512)8 into a decimal number. K3

(16512)8 = (7498)10

PART B

S. No Question BTL
What are programming paradigms? Briefly explain about the
1. (16 Marks) K2
different categories of programming paradigms.
Draw a suitable block diagram of basic organization of a
2. (16 Marks) K2
computer system and describe the operations performed by it.
a) Explain in detail about algorithm and its advantages and (8 Marks) K2
disadvantages.
3.
b) Write an algorithm to generate the first n numbers in a (8 Marks) K3
Fibonacci series.
a) Summarize on the concepts of flowchart. (8 Marks) K2
4.
b) Draw a flowchart to find the factorial of a number. (8 Marks) K3
5. Describe the structure of a C program with a suitable example. (16 Marks) K1
a) Illustrate about the various data types in C language. (8 Marks) K2
6. b) Write a C program to find the sum of 10 non-negative (8 Marks) K3
numbers, entered by the user.
Explain the following in detail with examples:
7. a) Constants c) Keywords (16 Marks) K2
b) Enumeration d) Number system
Perform the following conversions in number system:
a) (55)10 = ( )8
b) (385.28)10 = ( )2
c) (0.515625)10 = ( )16
8. d) (1101)2 = ( )10 (16 Marks) K3
e) (1007)8 = ( )10
f) (1101)16 = ( )10
g) (100)8 = ( )16
h) (6E0.A15)16 = ( )2
Page|7

Unit II
OPERATOR AND EXPRESSIONS
Course Objective – COb 2: To implement programs using basic constructs of C

Course Outcome – CO2: Develop simple applications using various operators


in C.

Bloom’s Taxonomy Level: K1, K2, K3


Part A

S.No BTL
Question
. *
1. What is Standard I/O library functions and list 3 processing functions? K1
In C Language input and output function are available as C compiler
functions or C libraries provided with each C compiler implementation.
These all functions are collectively known as Standard I/O Library
function.
Here I/O stands for Input and Output used for different inputting and
outputting statements. These I/O functions are categorized into three
processing functions.
i. Console input/output function
ii. Disk input/output function
iii. Port input/output function
2. What is Console input/output function? K1
All the input/output statements deals with the console, so these are
also Console Input/Output functions. Console Input/Output function
access the three major files before the execution of a C program. They are,
i. Standard input (stdin)
ii. Standard Output (stdout)
iii. Standard Error (stderr)
3. Write about getchar() and putchar() functions. K1
getchar(): It is used for reading a single character from the keyboard. It is a
buffered function. Buffered functions get the input from the keyboard and
store it in the memory buffer temporally until you press the Enter key.
putchar():This function is an output function. It is used to display a single
character on the screen.
Eg. char initial; initial = getchar(); putchar(initial);
4. Define getch(). K1
It is a function is present in conio.h header file. It is used to read a single
character from the keyboard similar to getchar() function. The entered
character is immediately returned without waiting for the enter key. The
entered character does not show up on the console. So it can be used to accept
hidden passwords.
Eg. char pwd; pwd = getchar();
Page|8

5. Write a C program to explain the use of getch() function. K3


#include <stdio.h>
int main()
{
char n;
puts("Enter the Char");
n = getch();
puts("Char is :");
putchar(n);
getch();
}
Output:
Enter the Char L
Char is L
6. Define printf and scanf. K1
printf()
This is an output function. It is used to display a text message and to
display the mixed type (int, float, char) of data on screen. The general syntax
is as below:
printf("control strings", v1, v2, v3,. ............ , vn);
Eg. printf(“ID: %d \n NAME: %s”, id, name);
scanf()
The scanf() function is an input function. It used to read the mixed
type of data from keyboard. You can read integer, float and character data by
using its control codes or format codes. The general syntax is as below:
scanf("control strings", &arg1, &arg2,. ............ , &argn);
Eg. scanf(%s %d”, name, &age);
7. What are Operators? What are the different types of operators? K1
Operators are one of the features in C which has symbols that can be used to
perform mathematical, relational, bitwise, conditional, or logical
manipulations. An operator is a symbol that are used to perform operations
on variables and values.
The different types of operators in C are:
 Arithmetic Operators
 Relational Operators
 Logical Operators
 Bitwise Operators
 Assignment Operators
 Miscellaneous Operators
8. What are Arithmetic Operators? K1
Arithmetic Operators are the type of operators in C that are used to perform
mathematical operations on operands in a C program. They can be used in
programs to define expressions and mathematical formulas. The different
arithmetic operators in C are +, -, *, /, %
Page|9

9. Define Logical Operator. K1


Logical Operators are used to combine two or more conditions/constraints or
to complement the evaluation of the original condition in consideration. The
result of the operation of a logical operator is a boolean value either true or
false. The different logical operators in C are &&, ||, !
10. Write a note on increment and decrement operators. K1
The increment operator ( ++ ) is used to increment the value of a variable
in an expression by 1. It can be used on variables of the numeric type such as
integer, float, character, pointers, etc. Eg. int a; a++; ++a;
In pre-increment, the value is incremented first according to the
precedence and then the less priority operations are done. In post-increment,
the increment operator is used as the suffix of the operand.
The decrement operator ( -- ) is used to decrement the value of a variable
by 1 in an expression. Eg. int a; a--; --a;
In the Pre-Decrement, the value is first decremented and then used inside the
expression. Whereas in the Post-Decrement, the value is first used inside the
expression and then decremented.
11. What is ternary operator? K1
We use the ternary operator in C to run one code when the condition is true
and another code when the condition is false.
Syntax: testCondition ? expression1 : expression 2;
Eg. (age >= 18) ? printf("Can Vote") : printf("Cannot Vote");
12. What is an expression in C? What are the ways of writing an expression K1
in C?
An expression in C is a
combination of operands and
operators – it computes a single
value stored in a variable. The
C Expressions can be defined
by the number of operands,
operators, and their positions.
13. Define if statement. Also draw its flow diagram. K1
‘If’ is the most powerful decision-
making statement in C language. Thus, it is used
to control the execution of statements. ‘If’ is
used along with an expression. It is a two-way
branching or decision-making statement.

Syntax:
if (test expression)
{
Statements;
}
P a g e | 10

14. K3
Write a C program for printing the numbers from 1 to 10 using for loop.
#include <stdio.h>
int main()
{
int i;
for (i = 1; i < 11; ++i)
{
printf("%d ", i);
}
return 0;
}

15. What is switch K2


Syntax:
statement? switch(expression)
Write its syntax. {
case constant-expression :
statement(s);
break; /* optional */
case constant-expression :
statement(s);
break; /* optional */
/* you can have any number of case statements */
default : /* Optional */
statement(s);
}

A switch statement allows a variable to be tested for equality against a list of


values. Each value is called a case, and the variable being switched on is
checked for each switch case.
P a g e | 11

16. Differentiate break and continue statements. K2


break: A branching statement that terminates the existing structure.
continue: A branching statement that causes a loop to stop its current
iteration and begin the next one.

17. K2
Describe the syntax of for loop.
Syntax:
for (initialize expression; test expression; update expression)
{
body of for loop;
}

 Initialization Expression: In this expression, we assign a loop variable or


loop counter to some value. for example: int i=1;
 Test Expression: In this expression, test conditions are performed. If the
condition evaluates to true then the loop body will be executed and then
an update of the loop variable is done. If the test expression becomes false
then the control will exit from the loop. for example, i<=9;
 Update Expression: After execution of the loop body loop variable is
updated by some value it could be incremented, decremented, multiplied,
or divided by any value.
Write a C program to fin the sum of numbers from 1 to 5 using while K3
18. loop.
#include <stdio.h>
int main()
{
int i = 1, sum = 0;
P a g e | 12

while (i <= 5) {
sum = sum + i;
++i;
}
printf("Sum of 1 to 5 = %d", sum);
return 0;
}
19. Differentiate between formatted and unformatted you input and output
functions?
Formatted I/P functions:
These functions allow us to supply the input in a fixed format and let us
obtain the output in the specified form. Formatted output converts the internal
binary representation of the data to ASCII characters which are written to the K2
output file.
Ex: printf, scanf functions
Unformatted I/O functions:
There are several standard library functions available under this category-
those that can deal with a string of characters. Unformatted Input/Output is
the most basic form of input/output. Unformatted input/output transfers the
internal binary representation of the data directly between memory and the
file.
Ex: gets,puts, getchar,putchar functions

20. What is the basic difference between for loop and while loop? K2
For loop is used when the number of iterations is known
already. Initialization of iteration variable, test condition and update of the
iteration variable are built-in in the for loop statement.
While loop is used when the number of iterations is not known already. The
iteration variable is initialized before the loop starts, and it is updated in every
iteration of the loop.
21. What are the differences between while loop and do-while loop? K2
WHILE LOOP DO-WHILE LOOP
Entry controlled loop Exit controlled loop
In while-loop, the given condition In do-while-loop, the given body of
is evaluated first and then the body the loop is executed first and then
of the loop is executed. the given condition is checked.
The body of the loop would be The body of the loop would be
executed only if the condition is executed at least once even if the
true. condition is false.
Syntax: Syntax:
while(condition) do
{ {
Body of the loop; Body of the loop;
} } while(condition);
P a g e | 13

Part B
S.No. Question BTL *
1. Explain the various input and output statements in C. K1
What are the different types of operators in C? Discuss each one of them
2. K2
with suitable illustrations.
a) Explain in detail about expressions in C. (8
marks) K2
3. b) What is precedence and order of evaluation? Explain in detail. (8 K2
marks)
4. Explain about decision making statements with suitable examples. K1
Explain switch statement with relevant example. (8
marks) K1
5.
Write a C program to design a simple calculator. (8 K3
marks)
Write in detail about the various looping statements available in C with
6. K2
illustrative programs.
a) Write a C program to reverse the digits of a number. (8
marks) K3
7. b) Write a C program to display the Fibonacci series. (8 K3
marks)
a) Write a C program to solve a quadratic equation. (8 marks)

b) Write a C program to check whether a given number is prime or not. K3


8.
K3
(8 marks)
9. a) Write a C program for finding whether given number is Armstrong
number or not. (8 marks)
b) Write a C program to find whether the given number is palindrome or K3
not. (8 marks) K3

10. a) Write a C program to find the factorial of a given number. (8 marks) K3


K3
b) Write a C program to find the sum of a digits of a number.
(8 marks)

Unit III
ARRAYS AND STRINGS
Course Objective – COb 3: To develop C programs using Arrays and Strings

Course Outcome - CO3 : Design and Implement Applications using Array and
Strings

Bloom’s Taxonomy Level: K1, K2, K3


Part A

S.No. Question BTL*


P a g e | 14
1. What is an array? K1
An array is a derived data type. It is a collection of data elements of similar
data type.
The data elements are stored in contiguous memory location. All values
share a common name Linear data structure. The elements are organized in
a sequential order.
Syntax :datatype arrayname[size];
Eg. int a[10];
2. How can we declare and initialize 1-D, 2-D array? Give examples. K1
P a g e | 15

One-Dimensional Array: The array elements are arranged in rows or


columns. The data are stored in continuous memory location.
Syntax :datatype arrayname[array size];
Example: int a[5]={1,2,3,4,5};
Two-Dimensional Array: The array elements are thought to be stored in
the form of rows and columns.
Syntax :datatype arrayname[row size][column size];
int a[2][3] = {{10, 8, 16}, {5, 9, 12}};
3. What does array declaration inform the compiler? K2
1. Type of the Array
2. Name of the Array
3. Number of Dimension
4. Number of Elements in Each Dimension
4. Mention the characteristics of an array. K2
Characteristics Of An Array:
1. All the data elements share the same name, and they are distinguished
from one another with the help of an element number.
2. All the data elements are of the same data type.
3. Any particular element of an array can be modified separately without
disturbing other elements.
4. The index of an element in an array plays major role for accessing each
element.
5. What is the advantage of using arrays in C? K2
 Arrays make the code more optimized and clean since we can store
multiple elements in a single array at once, so we do not have to write
or initialize them multiple times.
 Every element can be traversed in an array using a single loop.
 Arrays make sorting much easier. Elements can be sorted by writing a
few lines of code.
 Any array element can be accessed in any order either from the front or
rear in O(1) time.
 Insertion or deletion of the elements can be done in linear complexity in
an array
6. State the limitations of arrays in C. K2
 Array is Static Data Structure.
 We cannot change the size of array in run-time.
 We must know in advance that how many elements are to be stored in
array.
 Only elements of same data types can be stored in an array. We cannot
store elements of multiple data types in a single array.
 As Array elements are stored in consecutive memory locations. So,
insertions and deletions of an element is time consuming as we have to
shift other elements one position ahead or back respectively.
P a g e | 16

7. Write a C program to print the array elements in reverse order. K3


#include<stdio.h>
int main()
{
intarr[] = {1, 2, 3, 4, 5};
int length = sizeof(arr)/sizeof(arr[0]);
printf("Original array: \n");
for (int i = 0; i < length; i++)
{
printf("%d ", arr[i]);
}
printf("\n");
printf("Array in reverse order: \n");
for (int i = length-1; i >= 0; i--) {
printf("%d ", arr[i]);
}
return 0;
}
8. Write a C program to find the smallest element in an array. K3
#include<stdio.h>
int main()
{
int a[30], i, num, smallest;
printf("\nEnter no of elements :");
scanf("%d", &num);
for (i = 0; i <num; i++)
scanf("%d", &a[i]);
smallest = a[0];
for (i = 0; i < num; i++)
{
if (a[i] < smallest)
smallest = a[i];
}
printf("\nSmallest Element : %d", smallest);
return (0);
}
P a g e | 17

9. Illustrate how a 2-dimensional array is stored. K2


A 2-d array a[2][3] = {{11, 22, 33}, {44, 55, 66}} can be represented as
below.
Col 0 Col 1 Col 2
Row 0 11 22 33
Row 1 44 55 66

It will be stored in memory as below (if int takes 2 bytes).


Memory 4000 4002 4004 4006 4008 4010
Address
Data 11 22 33 44 55 66
Array Index a[0][0] a[0][1] a[0][2] a[1][0] a[1][1] a[1][2]
10. Define strings. K1
String in C programming is a sequence of characters terminated with a null
character ‘\0’. Strings are defined as an array of characters. The difference
between a character array and a string is the string is terminated with a
unique character ‘\0’.
Eg: char str_name[size];
11. What are the different ways to initialize a string in C? K1
There are 4 ways to Initialize a String in C.
1. Assigning a string literal without size
2. Assigning a string literal with a predefined size
3. Assigning character by character with size
4. Assigning character by character without size
12. List any 4 string functions and their uses. K2
S.No Function Syntax Description
1. strlen( ) strlen(str) Determines the length of the string
2. strcpy( ) strcpy(d, s) Copies a string from source to
destination
3. strcmp( ) strcmp(s1, s2) Compares the characters of two
strings.
4. strcat( ) strcat(s1, s2) Appends the second string (s2) to the
first string (s1).
13. What is the use of ‘\0’ and ‘%s’? K1
‘\0’ is the escape sequence for null character it is automatically added at
the end of the string.
‘%s’ is a format specifier for string. It is used in scanf( ) and printf( )
functions to get the string input or to print string output
14. Write a C program to find the length of given string. K3
#include <stdio.h>
int main()
{
char s[1000], i;
printf("Enter a string: ");
scanf("%s", s);
P a g e | 18

for(i = 0; s[i] != '\0'; ++i);


printf("Length of string: %d", i);
return 0;
}
15. What is the role of strrev( )? K2
The function strrev( ) is used to reverse a string. This function takes only
one argument and return only one argument.
Syntax :strrev(string_to_be_reversed);
Eg.:
printf("String before strrev( ): %s\n",name);
printf("String after strrev( ): %s",strrev(name));

Output:
String before strrev( ): computer
String after strrev( ): retupmoc
16. Mention the various string manipulation Functions in C. K1
strcpy(s1, s2); Copies string s2 into string s1.
strcat(s1, s2); Concatenates string s2 onto the end of string s1.
strlen(s1);Returns the length of string s1.
strcmp(s1, s2); Returns 0 if s1 and s2 are the same; less than 0 if
s1<s2;greater than 0 if s1>s2.
strchr(s1, ch); Returns a pointer to the first occurrence of character ch in
string s1.
strstr(s1, s2); Returns a pointer to the first occurrence of string s2 in string
s1.
17. What is sorting algorithm? K2
A sorting algorithm is used to rearrange a given array or list of elements in
ascending or descending order according to a comparisons on the elements.
The comparison operator is used to decide the new order of elements in the
respective data structure.
18. List some types of sorting. K2
 Merge sort
 Quick sort
 Bubble sort
 Insertion sort
19. What is searching? What are the two different types of searching? K1
Searching is a process used to check for an element whether it is found or
not in any data structure where it is stored. If it is found, it can be accessed.
The two different types of searching are;
1. Linear search (or) Sequential search
2. Binary search
20. Write a C program to create a matrix. K3
C program to create a 2 x 3 matrix:
#include <stdio.h>
#include <conio.h>
P a g e | 19

void main()
{
int a[2][3], i, j;
clrscr();
printf("\nENTER VALUES FOR THE MATRIX:\n");
for(i = 0; i < 2; i++)
for(j = 0; j < 3; j++)
scanf("%d", &a[i][j]);
printf("\nTHE MATRIX:\n");
for(i = 0;i < 2; i++)
{
for(j = 0; j < 3; j++)
printf("%5d",a[i][j]);
printf("\n");
}
getch();
}

Part B
S.No. Question BTL *
1. What is an array? Explain the declaration and initialization of one K2
dimensional with an example.
2. Explain the declaration and initialization of two dimensional array with an K2
example.
3. a) Write a program in c to find the first and second biggest element from K3
the given array of the integers. (8
marks) K3
b) Write a C program to reverse a string without changing the position of
special characters. (8
marks)
4. Explain in detail about string and the various string operations with relevant K2
examples.
5. Write a C program for to sort 10 names. K3
6. What is sorting? Explain any two types of sorting with programs and K3
examples.
7. Explain linear search and binary in detail with C programs. K3
8. a) Write a C program for matrix addition and subtraction. (8 K3
marks) K3
b) Write a C program to find the product of 2 matrices. (8
marks)

You might also like