2025 100203

B.Tech 2nd Semester Examination, 2025

Time 03 Hours
Full Marks 70
Instructions:
  • The marks are indicated in the right-hand margin.
  • There are NINE questions in this paper.
  • Attempt FIVE questions in all.
  • Question No. 1 is compulsory.

Q.1 Choose the correct option for the following questions (Answer any seven):

Q1.1

The correct syntax for an if-statement is

a)

if condition() { }

b)

if (condition) {}

c)

if (condition) []

d)

if {condition}

Q1.2

C function execution always begins from

a)

main()

b)

constructor

c)

user-defined function

d)

header file

Q1.3

Which storage class has the default value of a variable as zero?

a)

auto

b)

static

c)

extern

d)

register

Q1.4

Relational operators always return

a)

Float value

b)

0 or 1

c)

Character

d)

None

Q1.5

Which of the following is an exit-controlled loop?

a)

while loop

b)

for loop

c)

do-while loop

d)

None

Q1.6

Binary search works only on

a)

Unsorted list

b)

Doubly linked list

c)

Sorted list

d)

Any list

Q1.7

break keyword is used to

a)

Restart loop

b)

Terminate loop

c)

Skip iteration

d)

Exit program

Q1.8

In a union, memory allocated is equal to the size of

a)

Sum of all members

b)

Smallest member

c)

Largest member

d)

Twice the size

Q1.9

fopen("abc.txt","r") opens file in

a)

Write mode

b)

Append mode

c)

Read mode

d)

Read + Write mode

Q1.10

Which of the following problems can be solved using recursion?

a)

Fibonacci

b)

Factorial

c)

GCD

d)

All of the above

Q.2 Solve both questions :

Q2.1

Write an algorithm and draw the flowchart for checking whether a number is prime or not.

Q2.2

Differentiate between syntax errors, logical errors, compile-time errors, and run-time errors. Provide suitable examples.

Q.3 Solve both questions :

Q3.1

Explain function declaration, definition, and calling conventions in C. Discuss call by value and call by reference with examples.

Q3.2

Differentiate between while and do-while loop construct. Write a program for generating Fibonacci series using loop.

Q.4 Solve both questions :

Q4.1

Write the differences between if, if-else, and switch statements with examples.

Q4.2

Explain the use of break, continue, and goto statements with examples.

Q.5 Solve both questions :

Q5.1

How are arrays declared and initialized in C? What is bound checking? Why is it important in array programming?

Q5.2

What is recursion? Explain how recursion works with stack memory. Write a recursive program for finding the factorial of a number.

Q.6 Solve both questions :

Q6.1

Write a program to perform linear search in an array. Also find its complexity in Best, Average and Worst cases.

Q6.2

Describe the selection sort algorithm and implement it in C language.

Q.7 Solve both questions :

Q7.1

Explain various storage classes in C with proper examples.

Q7.2

Write a program to copy the contents of one file into another and explain each step of file IO.

Q.8 Solve both questions :

Q8.1

Explain arithmetic, relational, logical, bitwise and assignment operators in C along with their precedence rules and examples.

Q8.2

What is the difference between structure and union? Explain with an example.

Q.9 Write Short notes on any two of the following:


2025 V2 100203

B.Tech 2nd Semester Examination, 2025

Time 03 Hours
Full Marks 70
Instructions:
  • The marks are indicated in the right-hand margin.
  • There are NINE questions in this paper.
  • Attempt FIVE questions in all.
  • Question No. 1 is compulsory.

Q.1 Choose the correct option for the following questions (Answer any seven):

Q1.1

The correct syntax for an if-statement is

a)

if condition() { }

b)

if (condition) {}

c)

if (condition) []

d)

if {condition}

Q1.2

C function execution always begins from

a)

main()

b)

constructor

c)

user-defined function

d)

header file

Q1.3

Which storage class has the default value of a variable as zero?

a)

auto

b)

static

c)

extern

d)

register

Q1.4

Relational operators always return

a)

Float value

b)

0 or 1

c)

Character

d)

None

Q1.5

Which of the following is an exit-controlled loop?

a)

while loop

b)

for loop

c)

do-while loop

d)

None

Q1.6

Binary search works only on

a)

Unsorted list

b)

Doubly linked list

c)

Sorted list

d)

Any list

Q1.7

break keyword is used to

a)

Restart loop

b)

Terminate loop

c)

Skip iteration

d)

Exit program

Q1.8

In a union, memory allocated is equal to the size of

a)

Sum of all members

b)

Smallest member

c)

Largest member

d)

Twice the size

Q1.9

fopen("abc.txt","r") opens file in

a)

Write mode

b)

Append mode

c)

Read mode

d)

Read + Write mode

Q1.10

Which of the following problems can be solved using recursion?

a)

Fibonacci

b)

Factorial

c)

GCD

d)

All of the above

Q.2 Solve both questions :

Q2.1

Write an algorithm and draw the flowchart for checking whether a number is prime or not.

Q2.2

Differentiate between syntax errors, logical errors, compile-time errors, and run-time errors. Provide suitable examples.

Q.3 Solve both questions :

Q3.1

Explain function declaration, definition, and calling conventions in C. Discuss call by value and call by reference with examples.

Q3.2

Differentiate between while and do-while loop construct. Write a program for generating Fibonacci series using loop.

Q.4 Solve both questions :

Q4.1

Write the differences between if, if-else, and switch statements with examples.

Q4.2

Explain the use of break, continue, and goto statements with examples.

Q.5 Solve both questions :

Q5.1

How are arrays declared and initialized in C? What is bound checking? Why is it important in array programming?

Q5.2

What is recursion? Explain how recursion works with stack memory. Write a recursive program for finding the factorial of a number.

Q.6 Solve both questions :

Q6.1

Write a program to perform linear search in an array. Also find its complexity in Best, Average and Worst cases.

Q6.2

Describe the selection sort algorithm and implement it in C language.

Q.7 Solve both questions :

Q7.1

Explain various storage classes in C with proper examples.

Q7.2

Write a program to copy the contents of one file into another and explain each step of file IO.

Q.8 Solve both questions :

Q8.1

Explain arithmetic, relational, logical, bitwise and assignment operators in C along with their precedence rules and examples.

Q8.2

What is the difference between structure and union? Explain with an example.

Q.9 Write Short notes on any two of the following:

Q9.1
  • Type Casting
  • Compiler and Interpreter
  • Quick Sort
  • String Functions
a)

Type Casting

b)

Compiler and Interpreter

c)

Quick Sort

d)

String Functions


2025 V3 100203

B.Tech 2nd Semester Examination, 2025

Time 03 Hours
Full Marks 70
Instructions:
  • The marks are indicated in the right-hand margin.
  • There are NINE questions in this paper.
  • Attempt FIVE questions in all.
  • Question No. 1 is compulsory.

Q.1 Choose the correct option for the following questions (Answer any seven):

Q1.1

The correct syntax for an if-statement is

a)

if condition() { }

b)

if (condition) {}

c)

if (condition) []

d)

if {condition}

Q1.2

C function execution always begins from

a)

main()

b)

constructor

c)

user-defined function

d)

header file

Q1.3

Which storage class has the default value of a variable as zero?

a)

auto

b)

static

c)

extern

d)

register

Q1.4

Relational operators always return

a)

Float value

b)

0 or 1

c)

Character

d)

None

Q1.5

Which of the following is an exit-controlled loop?

a)

while loop

b)

for loop

c)

do-while loop

d)

None

Q1.6

Binary search works only on

a)

Unsorted list

b)

Doubly linked list

c)

Sorted list

d)

Any list

Q1.7

break keyword is used to

a)

Restart loop

b)

Terminate loop

c)

Skip iteration

d)

Exit program

Q1.8

In a union, memory allocated is equal to the size of

a)

Sum of all members

b)

Smallest member

c)

Largest member

d)

Twice the size

Q1.9

fopen("abc.txt","r") opens file in

a)

Write mode

b)

Append mode

c)

Read mode

d)

Read + Write mode

Q1.10

Which of the following problems can be solved using recursion?

a)

Fibonacci

b)

Factorial

c)

GCD

d)

All of the above

Q.2 Solve both questions :

Q2.1

Write an algorithm and draw the flowchart for checking whether a number is prime or not.

Q2.2

Differentiate between syntax errors, logical errors, compile-time errors, and run-time errors. Provide suitable examples.

Q.3 Solve both questions :

Q3.1

Explain function declaration, definition, and calling conventions in C. Discuss call by value and call by reference with examples.

Q3.2

Differentiate between while and do-while loop construct. Write a program for generating Fibonacci series using loop.

Q.4 Solve both questions :

Q4.1

Write the differences between if, if-else, and switch statements with examples.

Q4.2

Explain the use of break, continue, and goto statements with examples.

Q.5 Solve both questions :

Q5.1

How are arrays declared and initialized in C? What is bound checking? Why is it important in array programming?

Q5.2

What is recursion? Explain how recursion works with stack memory. Write a recursive program for finding the factorial of a number.

Q.6 Solve both questions :

Q6.1

Write a program to perform linear search in an array. Also find its complexity in Best, Average and Worst cases.

Q6.2

Describe the selection sort algorithm and implement it in C language.

Q.7 Solve both questions :

Q7.1

Explain various storage classes in C with proper examples.

Q7.2

Write a program to copy the contents of one file into another and explain each step of file IO.

Q.8 Solve both questions :

Q8.1

Explain arithmetic, relational, logical, bitwise and assignment operators in C along with their precedence rules and examples.

Q8.2

What is the difference between structure and union? Explain with an example.

Q.9 Write Short notes on any two of the following:

Q9.1
  • Type Casting
  • Compiler and Interpreter
  • Quick Sort
  • String Functions
a)

Type Casting

b)

Compiler and Interpreter

c)

Quick Sort

d)

String Functions


2025 V4 100203

B.Tech 2nd Semester Examination, 2025

Time 03 Hours
Full Marks 70
Instructions:
  • The marks are indicated in the right-hand margin.
  • There are NINE questions in this paper.
  • Attempt FIVE questions in all.
  • Question No. 1 is compulsory.

Q.1 Choose the correct option for the following questions (Answer any seven):

Q1.1

The correct syntax for an if-statement is

a)

if condition() { }

b)

if (condition) {}

c)

if (condition) []

d)

if {condition}

Q1.2

C function execution always begins from

a)

main()

b)

constructor

c)

user-defined function

d)

header file

Q1.3

Which storage class has the default value of a variable as zero?

a)

auto

b)

static

c)

extern

d)

register

Q1.4

Relational operators always return

a)

Float value

b)

0 or 1

c)

Character

d)

None

Q1.5

Which of the following is an exit-controlled loop?

a)

while loop

b)

for loop

c)

do-while loop

d)

None

Q1.6

Binary search works only on

a)

Unsorted list

b)

Doubly linked list

c)

Sorted list

d)

Any list

Q1.7

break keyword is used to

a)

Restart loop

b)

Terminate loop

c)

Skip iteration

d)

Exit program

Q1.8

In a union, memory allocated is equal to the size of

a)

Sum of all members

b)

Smallest member

c)

Largest member

d)

Twice the size

Q1.9

fopen("abc.txt","r") opens file in

a)

Write mode

b)

Append mode

c)

Read mode

d)

Read + Write mode

Q1.10

Which of the following problems can be solved using recursion?

a)

Fibonacci

b)

Factorial

c)

GCD

d)

All of the above

Q.2 Solve both questions :

Q2.1

Write an algorithm and draw the flowchart for checking whether a number is prime or not.

Q2.2

Differentiate between syntax errors, logical errors, compile-time errors, and run-time errors. Provide suitable examples.

Q.3 Solve both questions :

Q3.1

Explain function declaration, definition, and calling conventions in C. Discuss call by value and call by reference with examples.

Q3.2

Differentiate between while and do-while loop construct. Write a program for generating Fibonacci series using loop.

Q.4 Solve both questions :

Q4.1

Write the differences between if, if-else, and switch statements with examples.

Q4.2

Explain the use of break, continue, and goto statements with examples.

Q.5 Solve both questions :

Q5.1

How are arrays declared and initialized in C? What is bound checking? Why is it important in array programming?

Q5.2

What is recursion? Explain how recursion works with stack memory. Write a recursive program for finding the factorial of a number.

Q.6 Solve both questions :

Q6.1

Write a program to perform linear search in an array. Also find its complexity in Best, Average and Worst cases.

Q6.2

Describe the selection sort algorithm and implement it in C language.

Q.7 Solve both questions :

Q7.1

Explain various storage classes in C with proper examples.

Q7.2

Write a program to copy the contents of one file into another and explain each step of file IO.

Q.8 Solve both questions :

Q8.1

Explain arithmetic, relational, logical, bitwise and assignment operators in C along with their precedence rules and examples.

Q8.2

What is the difference between structure and union? Explain with an example.

Q.9 Write Short notes on any two of the following:


2025 V5 100203

B.Tech 2nd Semester Examination, 2025

Time 03 Hours
Full Marks 70
Instructions:
  • The marks are indicated in the right-hand margin.
  • There are NINE questions in this paper.
  • Attempt FIVE questions in all.
  • Question No. 1 is compulsory.

Q.1 Choose the correct option for the following questions (Answer any seven):

Q1.1

The correct syntax for an if-statement is

a)

if condition() { }

b)

if (condition) {}

c)

if (condition) []

d)

if {condition}

Q1.2

C function execution always begins from

a)

main()

b)

constructor

c)

user-defined function

d)

header file

Q1.3

Which storage class has the default value of a variable as zero?

a)

auto

b)

static

c)

extern

d)

register

Q1.4

Relational operators always return

a)

Float value

b)

0 or 1

c)

Character

d)

None

Q1.5

Which of the following is an exit-controlled loop?

a)

while loop

b)

for loop

c)

do-while loop

d)

None

Q1.6

Binary search works only on

a)

Unsorted list

b)

Doubly linked list

c)

Sorted list

d)

Any list

Q1.7

break keyword is used to

a)

Restart loop

b)

Terminate loop

c)

Skip iteration

d)

Exit program

Q1.8

In a union, memory allocated is equal to the size of

a)

Sum of all members

b)

Smallest member

c)

Largest member

d)

Twice the size

Q1.9

fopen("abc.txt","r") opens file in

a)

Write mode

b)

Append mode

c)

Read mode

d)

Read + Write mode

Q1.10

Which of the following problems can be solved using recursion?

a)

Fibonacci

b)

Factorial

c)

GCD

d)

All of the above

Q.2 Solve both questions :

Q2.1

Write an algorithm and draw the flowchart for checking whether a number is prime or not.

Q2.2

Differentiate between syntax errors, logical errors, compile-time errors, and run-time errors. Provide suitable examples.

Q.3 Solve both questions :

Q3.1

Explain function declaration, definition, and calling conventions in C. Discuss call by value and call by reference with examples.

Q3.2

Differentiate between while and do-while loop construct. Write a program for generating Fibonacci series using loop.

Q.4 Solve both questions :

Q4.1

Write the differences between if, if-else, and switch statements with examples.

Q4.2

Explain the use of break, continue, and goto statements with examples.

Q.5 Solve both questions :

Q5.1

How are arrays declared and initialized in C? What is bound checking? Why is it important in array programming?

Q5.2

What is recursion? Explain how recursion works with stack memory. Write a recursive program for finding the factorial of a number.

Q.6 Solve both questions :

Q6.1

Write a program to perform linear search in an array. Also find its complexity in Best, Average and Worst cases.

Q6.2

Describe the selection sort algorithm and implement it in C language.

Q.7 Solve both questions :

Q7.1

Explain various storage classes in C with proper examples.

Q7.2

Write a program to copy the contents of one file into another and explain each step of file IO.

Q.8 Solve both questions :

Q8.1

Explain arithmetic, relational, logical, bitwise and assignment operators in C along with their precedence rules and examples.

Q8.2

What is the difference between structure and union? Explain with an example.

Q.9 Write Short notes on any two of the following:

Q9.1
a)

Type Casting

b)

Compiler and Interpreter

c)

Quick Sort

d)

String Functions


2025 100204

B.Tech 2nd Semester Examination, 2025 (Old Course)

Time 03 Hours
Full Marks 70
Instructions:
  • The marks are indicated in the right-hand margin.
  • There are NINE questions in this paper.
  • Attempt FIVE questions in all.
  • Question No. 1 is compulsory.

Q.1 Choose the correct option/answer the following (Any seven question only):

Q1.1

Which of the following cannot be a variable name in C?

a)

volatile

b)

true

c)

friend

d)

export

Q1.2

Which of the following typecasting is accepted by C language

a)

Widening conversions

b)

Narrowing conversions

c)

Widening & Narrowing conversions

d)

None of the mentioned

Q1.3

Which of the following is NOT possible with any 2 operators in C?

a)

Different precedence, same associativity

b)

Different precedence, different associativity

c)

Same precedence, different associativity

d)

All of the mentioned

Q1.4

Functions can return enumeration constants in C?

a)

true

b)

false

c)

depends on the compiler

d)

depends on the standard

Q1.5

C preprocessors can have compiler specific features.

a)

True

b)

False

c)

Depends on the standard

d)

Depends on the platform

Q1.6

How many number of pointer (*) does C have against a pointer variable declaration?

a)

7

b)

127

c)

255

d)

No limits

Q1.7

Which of the following is not possible statically in C language?

a)

Jagged Array

b)

Rectangular Array

c)

Cuboidal Array

d)

Multidimensional Array

Q1.8

What will be the value of the following assignment expression?
(x = foo())!=1 considering foo() returns 2

a)

2

b)

True

c)

1

d)

0

Q1.9

Comment on the following C statement
n=1; printf("%d, %d ", 3*n, n++);

a)

Output will be 3, 2

b)

Output will be 3, 1

c)

Output will be 6, 1

d)

Output is compiler dependent

Q1.10

What are the elements present in the array of the following C code?
int array[5]={5};

a)

5, 5, 5, 5, 5

b)

5, 0, 0, 0, 0

c)

5, NULL, NULL, NULL, NULL

d)

5

Q.2 Solve both questions :

Q2.1

Explain the major components of a computer system. How does the operating system help in program execution?

Q2.2

Write an algorithm and flowchart to find the largest of three numbers.

Q.3 Solve both questions :

Q3.1

Explain the different arithmetic operators in C. Write the rules for evaluating arithmetic expressions with precedence and associativity.

Q3.2

Write a program to reverse a number using a loop. Explain the concept of an infinite loop with examples. Why do infinite loops occur?

Q.4 Solve both questions :

Q4.1

Explain array declaration and initialization with examples for 1-D and 2-D arrays. Also explain the concept of bound checking.

Q4.2

Write a C program to perform Binary Search on a sorted array.

Q.5 Solve both questions :

Q5.1

What is call by reference? How is passing an array to a function an example of call by reference? Explain with code.

Q5.2

Write a program that reads marks of 5 students into an array and uses a function to compute the average. Demonstrate passing an array to a function.

Q.6 Solve both questions :

Q6.1

Define a structure Student with name, roll, marks. Write a C program to input data for 3 students and print it.

Q6.2

Write a note on accessing structure elements using (a) dot operator, (b) pointer-to-structure. Give examples.

Q.7 Solve both questions :

Q7.1

Explain the concept of pointers in C. How are pointers defined and used? Illustrate with a program that swaps two numbers using pointers.

Q7.2

Write a C program using pointers to reverse an array in-place. Explain how pointers are used in the program.

Q.8 Solve both questions :

Q8.1

Write a recursive C program to find the factorial of a number. Also explain base case and recursive case.

Q8.2

Explain the Ackermann function. Write a recursive program for it. Why is it not suitable for large values?

Q.9 Write short notes on any two of the following:

Q9.1
a)

Self-Referential Structures

b)

Global and Static Variables

c)

Type Casting in C

d)

Compiler and Linker


2025 OLD 100204

B.Tech 2nd Semester Examination, 2025 (Old Course)

Time 03 Hours
Full Marks 70
Instructions:
  • The marks are indicated in the right-hand margin.
  • There are NINE questions in this paper.
  • Attempt FIVE questions in all.
  • Question No. 1 is compulsory.

Q.1 Choose the correct option/answer the following (Any seven question only):

Q1.1

Which of the following cannot be a variable name in C?

a)

volatile

b)

true

c)

friend

d)

export

Q1.2

Which of the following typecasting is accepted by C language

a)

Widening conversions

b)

Narrowing conversions

c)

Widening & Narrowing conversions

d)

None of the mentioned

Q1.3

Which of the following is NOT possible with any 2 operators in C?

a)

Different precedence, same associativity

b)

Different precedence, different associativity

c)

Same precedence, different associativity

d)

All of the mentioned

Q1.4

Functions can return enumeration constants in C?

a)

true

b)

false

c)

depends on the compiler

d)

depends on the standard

Q1.5

C preprocessors can have compiler specific features.

a)

True

b)

False

c)

Depends on the standard

d)

Depends on the platform

Q1.6

How many number of pointer (*) does C have against a pointer variable declaration?

a)

7

b)

127

c)

255

d)

No limits

Q1.7

Which of the following is not possible statically in C language?

a)

Jagged Array

b)

Rectangular Array

c)

Cuboidal Array

d)

Multidimensional Array

Q1.8

What will be the value of the following assignment expression?
(x = foo())!=1 considering foo() returns 2

a)

2

b)

True

c)

1

d)

0

Q1.9

Comment on the following C statement
n=1; printf("%d, %d ", 3*n, n++);

a)

Output will be 3, 2

b)

Output will be 3, 1

c)

Output will be 6, 1

d)

Output is compiler dependent

Q1.10

What are the elements present in the array of the following C code?
int array[5]={5};

a)

5, 5, 5, 5, 5

b)

5, 0, 0, 0, 0

c)

5, NULL, NULL, NULL, NULL

d)

5

Q.2 Solve both questions :

Q2.1

Explain the major components of a computer system. How does the operating system help in program execution?

Q2.2

Write an algorithm and flowchart to find the largest of three numbers.

Q.3 Solve both questions :

Q3.1

Explain the different arithmetic operators in C. Write the rules for evaluating arithmetic expressions with precedence and associativity.

Q3.2

Write a program to reverse a number using a loop. Explain the concept of an infinite loop with examples. Why do infinite loops occur?

Q.4 Solve both questions :

Q4.1

Explain array declaration and initialization with examples for 1-D and 2-D arrays. Also explain the concept of bound checking.

Q4.2

Write a C program to perform Binary Search on a sorted array.

Q.5 Solve both questions :

Q5.1

What is call by reference? How is passing an array to a function an example of call by reference? Explain with code.

Q5.2

Write a program that reads marks of 5 students into an array and uses a function to compute the average. Demonstrate passing an array to a function.

Q.6 Solve both questions :

Q6.1

Define a structure Student with name, roll, marks. Write a C program to input data for 3 students and print it.

Q6.2

Write a note on accessing structure elements using (a) dot operator, (b) pointer-to-structure. Give examples.

Q.7 Solve both questions :

Q7.1

Explain the concept of pointers in C. How are pointers defined and used? Illustrate with a program that swaps two numbers using pointers.

Q7.2

Write a C program using pointers to reverse an array in-place. Explain how pointers are used in the program.

Q.8 Solve both questions :

Q8.1

Write a recursive C program to find the factorial of a number. Also explain base case and recursive case.

Q8.2

Explain the Ackermann function. Write a recursive program for it. Why is it not suitable for large values?

Q.9 Write short notes on any two of the following:


2024 100104

B.Tech 1st Semester Examination, 2024 (Old)

Time 03 Hours
Full Marks 70
Instructions:
  • The marks are indicated in the right-hand margin.
  • There are NINE questions in this paper.
  • Attempt FIVE questions in all.
  • Question No. 1 is compulsory.

Q.1 Choose the correct option for the following questions (Answer any seven only):

Q1.1

Where is a program stored and executed?

a)

Hard Disk

b)

Main Memory (RAM)

c)

Cache

d)

ROM

Q1.2

What is the output of a compiler?

a)

Source code

b)

Flowchart

c)

Executable code

d)

Algorithm

Q1.3

Which storage class has the default value of a variable as zero?

a)

auto

b)

extern

c)

static

d)

register

Q1.4

What is the result of 5% 2 in C?

a)

2.5

b)

1

c)

2

d)

0

Q1.5

What type of array is used to store string?

a)

int

b)

float

c)

char

d)

double

Q1.6

Binary search works only on:

a)

Unsorted list

b)

Doubly linked list

c)

Sorted list

d)

Any list

Q1.7

Which operator is used to access members of a structure using a pointer?

a)

.

b)

->

c)
d)

&

Q1.8

What is the output of (&x)*(\&x) in C?

a)

Address of x

b)

Error

c)

Value of x

d)

Nothing

Q1.9

Which function is used to open a file in C?

a)

fopen()

b)

file()

c)

openfile()

d)

fcreate()

Q1.10

Which of the following problems can be solved using recursion?

a)

Fibonacci

b)

GCD

c)

Factorial

d)

All of the above

Q.2 Solve both questions :

Q2.1

Draw a flowchart to find the largest of three numbers.

Q2.2

Explain different storage classes in C.

Q.3 Solve both questions :

Q3.1

What is type casting in programming? Differentiate between implicit and explicit type conversion with examples.

Q3.2

Explain operator precedence and associativity with examples.

Q.4 Solve both questions :

Q4.1

Write the differences between if, if-else, and switch statements with examples.

Q4.2

Explain the concept of pointer to pointer with a code example. What is a self-referential structure?

Q.5 Solve both questions :

Q5.1

How are arrays declared and initialized in C? What is bound checking? Why is it important in array programming?

Q5.2

Explain the different modes of opening a file in C. Give examples.

Q.6 Solve both questions :

Q6.1

Write a program to perform linear search in an array.

Q6.2

Describe the bubble sort algorithm and write its implementation in C.

Q.7 Solve both questions :

Q7.1

What is the difference between call by value and call by reference? Explain with examples.

Q7.2

What is the scope of a variable? Explain local and global scope with examples.

Q.8 Solve both questions :

Q8.1

What is recursion? Write a recursive function to compute the nth Fibonacci number.

Q8.2

What is the difference between structure and union? Explain with an example.

Q.9 Write Short notes on any two of the following:

Q9.1

Self-Referential Structure

Q9.2

Compiler and Linker

Q9.3

Syntax and logical errors

Q9.4

Bitwise Operator


2024 V3 100104

B.Tech 1st Semester Examination, 2024 (Old)

Time 03 Hours
Full Marks 70
Instructions:
  • The marks are indicated in the right-hand margin.
  • There are NINE questions in this paper.
  • Attempt FIVE questions in all.
  • Question No. 1 is compulsory.

Q.1 Choose the correct option for the following questions (Answer any seven only):

Q1.1

Where is a program stored and executed?

a)

Hard Disk

b)

Main Memory (RAM)

c)

Cache

d)

ROM

Q1.2

What is the output of a compiler?

a)

Source code

b)

Flowchart

c)

Executable code

d)

Algorithm

Q1.3

Which storage class has the default value of a variable as zero?

a)

auto

b)

extern

c)

static

d)

register

Q1.4

What is the result of 5% 2 in C?

a)

2.5

b)

1

c)

2

d)

0

Q1.5

What type of array is used to store string?

a)

int

b)

float

c)

char

d)

double

Q1.6

Binary search works only on:

a)

Unsorted list

b)

Doubly linked list

c)

Sorted list

d)

Any list

Q1.7

Which operator is used to access members of a structure using a pointer?

a)

.

b)

->

c)
d)

&

Q1.8

What is the output of (&x)*(\&x) in C?

a)

Address of x

b)

Error

c)

Value of x

d)

Nothing

Q1.9

Which function is used to open a file in C?

a)

fopen()

b)

file()

c)

openfile()

d)

fcreate()

Q1.10

Which of the following problems can be solved using recursion?

a)

Fibonacci

b)

GCD

c)

Factorial

d)

All of the above

Q.2 Solve both questions :

Q2.1

Draw a flowchart to find the largest of three numbers.

Q2.2

Explain different storage classes in C.

Q.3 Solve both questions :

Q3.1

What is type casting in programming? Differentiate between implicit and explicit type conversion with examples.

Q3.2

Explain operator precedence and associativity with examples.

Q.4 Solve both questions :

Q4.1

Write the differences between if, if-else, and switch statements with examples.

Q4.2

Explain the concept of pointer to pointer with a code example. What is a self-referential structure?

Q.5 Solve both questions :

Q5.1

How are arrays declared and initialized in C? What is bound checking? Why is it important in array programming?

Q5.2

Explain the different modes of opening a file in C. Give examples.

Q.6 Solve both questions :

Q6.1

Write a program to perform linear search in an array.

Q6.2

Describe the bubble sort algorithm and write its implementation in C.

Q.7 Solve both questions :

Q7.1

What is the difference between call by value and call by reference? Explain with examples.

Q7.2

What is the scope of a variable? Explain local and global scope with examples.

Q.8 Solve both questions :

Q8.1

What is recursion? Write a recursive function to compute the nth Fibonacci number.

Q8.2

What is the difference between structure and union? Explain with an example.

Q.9 Write Short notes on any two of the following:

Q9.1

Self-Referential Structure

Q9.2

Compiler and Linker

Q9.3

Syntax and logical errors

Q9.4

Bitwise Operator


2024 V5 100104

B.Tech 1st Semester Examination, 2024 (Old)

Time 03 Hours
Full Marks 70
Instructions:
  • The marks are indicated in the right-hand margin.
  • There are NINE questions in this paper.
  • Attempt FIVE questions in all.
  • Question No. 1 is compulsory.

Q.1 Choose the correct option for the following questions (Answer any seven only):

Q1.1

Where is a program stored and executed?

a)

Hard Disk

b)

Main Memory (RAM)

c)

Cache

d)

ROM

Q1.2

What is the output of a compiler?

a)

Source code

b)

Flowchart

c)

Executable code

d)

Algorithm

Q1.3

Which storage class has the default value of a variable as zero?

a)

auto

b)

extern

c)

static

d)

register

Q1.4

What is the result of 5% 2 in C?

a)

2.5

b)

1

c)

2

d)

0

Q1.5

What type of array is used to store string?

a)

int

b)

float

c)

char

d)

double

Q1.6

Binary search works only on:

a)

Unsorted list

b)

Doubly linked list

c)

Sorted list

d)

Any list

Q1.7

Which operator is used to access members of a structure using a pointer?

a)

.

b)

->

c)
d)

&

Q1.8

What is the output of (&x)*(\&x) in C?

a)

Address of x

b)

Error

c)

Value of x

d)

Nothing

Q1.9

Which function is used to open a file in C?

a)

fopen()

b)

file()

c)

openfile()

d)

fcreate()

Q1.10

Which of the following problems can be solved using recursion?

a)

Fibonacci

b)

GCD

c)

Factorial

d)

All of the above

Q.2 Solve both questions :

Q2.1

Draw a flowchart to find the largest of three numbers.

Q2.2

Explain different storage classes in C.

Q.3 Solve both questions :

Q3.1

What is type casting in programming? Differentiate between implicit and explicit type conversion with examples.

Q3.2

Explain operator precedence and associativity with examples.

Q.4 Solve both questions :

Q4.1

Write the differences between if, if-else, and switch statements with examples.

Q4.2

Explain the concept of pointer to pointer with a code example. What is a self-referential structure?

Q.5 Solve both questions :

Q5.1

How are arrays declared and initialized in C? What is bound checking? Why is it important in array programming?

Q5.2

Explain the different modes of opening a file in C. Give examples.

Q.6 Solve both questions :

Q6.1

Write a program to perform linear search in an array.

Q6.2

Describe the bubble sort algorithm and write its implementation in C.

Q.7 Solve both questions :

Q7.1

What is the difference between call by value and call by reference? Explain with examples.

Q7.2

What is the scope of a variable? Explain local and global scope with examples.

Q.8 Solve both questions :

Q8.1

What is recursion? Write a recursive function to compute the nth Fibonacci number.

Q8.2

What is the difference between structure and union? Explain with an example.

Q.9 Write Short notes on any two of the following:

Q9.1

Self-Referential Structure

Q9.2

Compiler and Linker

Q9.3

Syntax and logical errors

Q9.4

Bitwise Operator


2024 V7 100104

B.Tech 1st Semester Examination, 2024 (Old)

Time 03 Hours
Full Marks 70
Instructions:
  • The marks are indicated in the right-hand margin.
  • There are NINE questions in this paper.
  • Attempt FIVE questions in all.
  • Question No. 1 is compulsory.

Q.1 Choose the correct option for the following questions (Answer any seven only):

Q1.1

Where is a program stored and executed?

a)

Hard Disk

b)

Main Memory (RAM)

c)

Cache

d)

ROM

Q1.2

What is the output of a compiler?

a)

Source code

b)

Flowchart

c)

Executable code

d)

Algorithm

Q1.3

Which storage class has the default value of a variable as zero?

a)

auto

b)

extern

c)

static

d)

register

Q1.4

What is the result of 5% 2 in C?

a)

2.5

b)

1

c)

2

d)

0

Q1.5

What type of array is used to store string?

a)

int

b)

float

c)

char

d)

double

Q1.6

Binary search works only on:

a)

Unsorted list

b)

Doubly linked list

c)

Sorted list

d)

Any list

Q1.7

Which operator is used to access members of a structure using a pointer?

a)

.

b)

->

c)
d)

&

Q1.8

What is the output of $ *(\&x) $ in C?

a)

Address of x

b)

Error

c)

Value of x

d)

Nothing

Q1.9

Which function is used to open a file in C?

a)

fopen()

b)

file()

c)

openfile()

d)

fcreate()

Q1.10

Which of the following problems can be solved using recursion?

a)

Fibonacci

b)

GCD

c)

Factorial

d)

All of the above

Q.2 Solve both questions :

Q2.1

Draw a flowchart to find the largest of three numbers.

Q2.2

Explain different storage classes in C.

Q.3 Solve both questions :

Q3.1

What is type casting in programming? Differentiate between implicit and explicit type conversion with examples.

Q3.2

Explain operator precedence and associativity with examples.

Q.4 Solve both questions :

Q4.1

Write the differences between if, if-else, and switch statements with examples.

Q4.2

Explain the concept of pointer to pointer with a code example. What is a self-referential structure?

Q.5 Solve both questions :

Q5.1

How are arrays declared and initialized in C? What is bound checking? Why is it important in array programming?

Q5.2

Explain the different modes of opening a file in C. Give examples.

Q.6 Solve both questions :

Q6.1

Write a program to perform linear search in an array.

Q6.2

Describe the bubble sort algorithm and write its implementation in C.

Q.7 Solve both questions :

Q7.1

What is the difference between call by value and call by reference? Explain with examples.

Q7.2

What is the scope of a variable? Explain local and global scope with examples.

Q.8 Solve both questions :

Q8.1

What is recursion? Write a recursive function to compute the nth Fibonacci number.

Q8.2

What is the difference between structure and union? Explain with an example.

Q.9 Write Short notes on any two of the following:

Q9.1

Self-Referential Structure

Q9.2

Compiler and Linker

Q9.3

Syntax and logical errors

Q9.4

Bitwise Operator


2024 V9 100104

B.Tech 1st Semester Examination, 2024 (Old)

Time 03 Hours
Full Marks 70
Instructions:
  • The marks are indicated in the right-hand margin.
  • There are NINE questions in this paper.
  • Attempt FIVE questions in all.
  • Question No. 1 is compulsory.

Q.1 Choose the correct option for the following questions (Answer any seven only):

Q1.1

Where is a program stored and executed?

a)

Hard Disk

b)

Main Memory (RAM)

c)

Cache

d)

ROM

Q1.2

What is the output of a compiler?

a)

Source code

b)

Flowchart

c)

Executable code

d)

Algorithm

Q1.3

Which storage class has the default value of a variable as zero?

a)

auto

b)

extern

c)

static

d)

register

Q1.4

What is the result of 5% 2 in C?

a)

2.5

b)

1

c)

2

d)

0

Q1.5

What type of array is used to store string?

a)

int

b)

float

c)

char

d)

double

Q1.6

Binary search works only on:

a)

Unsorted list

b)

Doubly linked list

c)

Sorted list

d)

Any list

Q1.7

Which operator is used to access members of a structure using a pointer?

a)

.

b)

->

c)
d)

&

Q1.8

What is the output of $ *(\&x) $ in C?

a)

Address of x

b)

Error

c)

Value of x

d)

Nothing

Q1.9

Which function is used to open a file in C?

a)

fopen()

b)

file()

c)

openfile()

d)

fcreate()

Q1.10

Which of the following problems can be solved using recursion?

a)

Fibonacci

b)

GCD

c)

Factorial

d)

All of the above

Q.2 Solve both questions :

Q2.1

Draw a flowchart to find the largest of three numbers.

Q2.2

Explain different storage classes in C.

Q.3 Solve both questions :

Q3.1

What is type casting in programming? Differentiate between implicit and explicit type conversion with examples.

Q3.2

Explain operator precedence and associativity with examples.

Q.4 Solve both questions :

Q4.1

Write the differences between if, if-else, and switch statements with examples.

Q4.2

Explain the concept of pointer to pointer with a code example. What is a self-referential structure?

Q.5 Solve both questions :

Q5.1

How are arrays declared and initialized in C? What is bound checking? Why is it important in array programming?

Q5.2

Explain the different modes of opening a file in C. Give examples.

Q.6 Solve both questions :

Q6.1

Write a program to perform linear search in an array.

Q6.2

Describe the bubble sort algorithm and write its implementation in C.

Q.7 Solve both questions :

Q7.1

What is the difference between call by value and call by reference? Explain with examples.

Q7.2

What is the scope of a variable? Explain local and global scope with examples.

Q.8 Solve both questions :

Q8.1

What is recursion? Write a recursive function to compute the nth Fibonacci number.

Q8.2

What is the difference between structure and union? Explain with an example.

Q.9 Write Short notes on any two of the following:

Q9.1

Self-Referential Structure

Q9.2

Compiler and Linker

Q9.3

Syntax and logical errors

Q9.4

Bitwise Operator


2024 100111

B.Tech 1st Semester Examination, 2024

Time 03 Hours
Full Marks 70
Instructions:
  • The marks are indicated in the right-hand margin.
  • There are NINE questions in this paper.
  • Attempt FIVE questions in all.
  • Question No. 1 is compulsory.

Q.1 Choose the correct answer the following (Any seven question only):

Q1.1

Which of the following is a valid variable name in C?

a)

2value

b)

@value

c)

value_2

d)

value#2

Q1.2

Which of these is not a valid data type in C?

a)

int

b)

real

c)

float

d)

char

Q1.3

Which of the following is the correct syntax for if statement?

a)

if [condition] then

b)

if condition then

c)

if (condition)

d)

if {condition}

Q1.4

What is the output of printf("%d", 5 + 3 * 2)?

a)

16

b)

11

c)

10

d)

13

Q1.5

Which header file is required to use printf()?

a)

stdlib.h

b)

conio.h

c)

stdio.h

d)

string.h

Q1.6

Which keyword is used to define a constant in C?

a)

final

b)

constant

c)

#define

d)

static

Q1.7

What is the index of the first element in an array?

a)

1

b)

-1

c)

0

d)

Depends on array

Q1.8

Which one is the logical AND operator in C?

a)

&

b)

|

c)

&&

d)

||

Q1.9

Which format specifier is used for printing float values?

a)

%d

b)

%c

c)

%f

d)

%x

Q1.10

Which of these is not a loop in C?

a)

for

b)

while

c)

do-while

d)

repeat-until

Q.2 Solve both questions :

Q2.1

Explain the structure of a C program with an example.

Q2.2

Describe basic data types in C with memory size.

Q.3 Solve both questions :

Q3.1

What is an algorithm. Write an algorithm to perform the addition of two numbers in C and draw a flowchart to represent the addition of two numbers.

Q3.2

Write a program to check whether a number is even or odd using if-else.

Q.4 Solve both questions :

Q4.1

Explain Arithmetic and Logical operators in C with example programs.

Q4.2

Explain Relational and Bitwise operators with example programs.

Q.5 Solve both questions :

Q5.1

Explain call by value and call by reference with examples.

Q5.2

What is the difference between library functions and user-defined functions?

Q.6 Solve both questions :

Q6.1

What is an array in C programming? Write advantages of using arrays. Explain a one-dimensional array with a suitable example program.

Q6.2

Describe the difference between character array and string.

Q.7 Solve both questions :

Q7.1

Write the difference Between Array and Structure in C programming.

Q7.2

Write the difference Between Structure and Union in C programming.

Q.8 Solve both questions :

Q8.1

What is a pointer? Explain pointer declaration and initialization with sample program.

Q8.2

What is file? Explain text file and binary file in details.

Q.9 Write short notes on any two of the following:

Q9.1
a)

Structure

b)

Union

c)

Recursion

d)

Fibonacci series program


2024 V2 100111

B.Tech 1st Semester Examination, 2024

Time 03 Hours
Full Marks 70
Instructions:
  • The marks are indicated in the right-hand margin.
  • There are NINE questions in this paper.
  • Attempt FIVE questions in all.
  • Question No. 1 is compulsory.

Q.1 Choose the correct answer the following (Any seven question only):

Q1.1

Which of the following is a valid variable name in C?

a)

2value

b)

@value

c)

value_2

d)

value#2

Q1.2

Which of these is not a valid data type in C?

a)

int

b)

real

c)

float

d)

char

Q1.3

Which of the following is the correct syntax for if statement?

a)

if [condition] then

b)

if condition then

c)

if (condition)

d)

if {condition}

Q1.4

What is the output of printf("%d", 5 + 3 * 2)?

a)

16

b)

11

c)

10

d)

13

Q1.5

Which header file is required to use printf()?

a)

stdlib.h

b)

conio.h

c)

stdio.h

d)

string.h

Q1.6

Which keyword is used to define a constant in C?

a)

final

b)

constant

c)

#define

d)

static

Q1.7

What is the index of the first element in an array?

a)

1

b)

-1

c)

0

d)

Depends on array

Q1.8

Which one is the logical AND operator in C?

a)

&

b)

|

c)

&&

d)

||

Q1.9

Which format specifier is used for printing float values?

a)

%d

b)

%c

c)

%f

d)

%x

Q1.10

Which of these is not a loop in C?

a)

for

b)

while

c)

do-while

d)

repeat-until

Q.2 Solve both questions :

Q2.1

Explain the structure of a C program with an example.

Q2.2

Describe basic data types in C with memory size.

Q.3 Solve both questions :

Q3.1

What is an algorithm. Write an algorithm to perform the addition of two numbers in C and draw a flowchart to represent the addition of two numbers.

Q3.2

Write a program to check whether a number is even or odd using if-else.

Q.4 Solve both questions :

Q4.1

Explain Arithmetic and Logical operators in C with example programs.

Q4.2

Explain Relational and Bitwise operators with example programs.

Q.5 Solve both questions :

Q5.1

Explain call by value and call by reference with examples.

Q5.2

What is the difference between library functions and user-defined functions?

Q.6 Solve both questions :

Q6.1

What is an array in C programming? Write advantages of using arrays. Explain a one-dimensional array with a suitable example program.

Q6.2

Describe the difference between character array and string.

Q.7 Solve both questions :

Q7.1

Write the difference Between Array and Structure in C programming.

Q7.2

Write the difference Between Structure and Union in C programming.

Q.8 Solve both questions :

Q8.1

What is a pointer? Explain pointer declaration and initialization with sample program.

Q8.2

What is file? Explain text file and binary file in details.

Q.9 Write short notes on any two of the following:

Q9.1
  • Structure
  • Union
  • Recursion
  • Fibonacci series program
a)

Structure

b)

Union

c)

Recursion

d)

Fibonacci series program


2023 100104

B.Tech. 1st Semester Examination, 2023

Time 03 Hours
Full Marks 70
Instructions:
  • The marks are indicated in the right-hand margin.
  • There are NINE questions in this paper.
  • Attempt FIVE questions in all.
  • Question No. 1 is compulsory.

Q.1 Choose the correct answer of the following (Any seven question only):

Q1.a

What is the output of the following code?

int x = 10;
x++;
printf("%d", x);
a)

Error

b)

10

c)

11

d)

9

Q1.b

Which function is used to dynamically allocate memory in C?

a)

malloc()

b)

calloc()

c)

realloc()

d)

all of the above

Q1.c

What is the output of the following code?

#include <stdio.h>
int main() {
  char *p = 0;
  *p = 'a';
  printf("%c", *p);
  return 0;
}
a)

It will print 'a'

b)

It will print 0

c)

Compile time error

d)

Runtime error

Q1.d

What are the elements present in the array of the following C code?

int array[6] = { 5 };
a)

5, 5, 5, 5, 5, 5

b)

5, 0, 0, 0, 0, 0

c)

6, 6, 6, 6, 6, 6

d)

(garbage), (garbage), (garbage), (garbage), (garbage), 5

Q1.e

What will be the output of the following C code?

void main() {
  int i = 0;
  while (i < 10) {
    i++;
    printf("hi\n");
    while (i < 8) {
      i++;
      printf("hello\n");
    }
  }
}
a)

hi is printed 8 times, hello 7 times and then hi 2 times

b)

hi is printed once, hello 7 times

c)

hi is printed once, hello 7 times and then hi 2 times

d)

None of the above.

Q1.f

What does the following declaration mean?

int (*ptr) [10];
a)

ptr is array of pointers to 10 integers.

b)

ptr is a pointer to an array of 10 integers.

c)

ptr is an array of 10 integers.

d)

ptr is a pointer to array of 10 characters.

Q1.g

C is ______ type of programming language?

a)

Object Oriented

b)

Procedural

c)

Bit level language

d)

Functional

Q1.h

Choose the right C statement.

a)

int my_age = 10;

b)

int my.age = 10;

c)

my age = 10;

d)

All are correct

Q1.i

Consider the following integer 2D array, which is stored in memory with the base address 1400. What would be the address of the element 14? [Assume that an integer value takes 4 bytes of memory space.]

int a[3][5] = {{1, 2, 3, 4, 5}, {6, 7, 8, 9, 10}, {11, 12, 13, 14, 15}};
a)

1440

b)

1444

c)

1448

d)

1452

Q1.j

Consider the following declaration of the variables:

int x, A[5][6], *p = &A[0][0];

Which of the following is/are the correct expression(s) to access A[3][5] and assign it to x?

a)

x = *(p + 23);

b)

x = *(p + 28);

c)

x = ((A + 5) + 3);

d)

x = ((A + 3) + 5);

Q2.a

Explain the difference between auto and static type storage variables with suitable example codes.

Q2.b

Differentiate between structures and unions in C. Write a C program to detect whether the computer is little endian or big endian using unions.

Q3.a

Write an efficient C program to search if the integer 24 is present in the given sorted array or not. If it is present, print the index where it is found.

Q3.b

Explain the insertion sort algorithm and its steps using an example. Consider the array: [5, 2, 4, 6, 1, 3].

Q4.a

Describe the concept of pointers in C programming language. Explain how pointers work and discuss their importance in programming, particularly in memory management and efficient data manipulation.

Q4.b

Write a C program to copy contents of one file to another. While doing so replace all lowercase characters to their equivalent uppercase characters.

Q5.a

Write a C Program to find the Euclidean distance between two points P(x, y) and Q(a, b) using structure representation of points P and Q.

Q5.b

Differentiate between call-by-value and call-by-reference with suitable examples.

Q6.a

Define arrays in C and explain their declaration and usage. Write a C program to reverse the content of an integer array without using auxiliary array.

Q6.b

Define implicit and explicit type casting in C. Provide code examples illustrating when each type of casting occurs and their potential side effects.

Q7.a

Explain the concept of nested loops. Describe how the break and continue statements alter the flow of control within C loops.

Q7.b

Explain the concept of algorithmic complexity and its significance in computer science. Using examples, illustrate how different algorithms exhibit various orders of complexity, such as constant time (O(1)), linear time (O(n)), logarithmic time (O(log n)), quadratic time (O(n^2)), and exponential time (O(2^n)).

Q8.a

The first 6 numbers of the Fibonacci series are: 0 1 1 2 3 5. Write a C program using recursion to find and print the Fibonacci series for first n terms.

Q8.b

Write a C program using recursion to find factorial of a given number n.

Q9.a

Write a C program for the following:

  1. Reverse a string without using strrev().
  2. Concatenate two strings without using strcat().
Q9.b

Write a C program to find result matrix after multiplying two given matrices using 2-D arrays. Check the multiplication criteria also while deriving the logic.


2022 100104

B.Tech 1st Semester Exam-2022

Time 03 Hours
Full Marks 70
Instructions:
  • The marks are indicated in the right-hand margin.
  • There are NINE questions in this paper.
  • Attempt FIVE questions in all.
  • Question No. 1 is compulsory.

Q.1 Choose the correct answer of the following (any seven):

Q1.1

What does the following declaration mean?
int *ptr [5];

a)

ptr is an array of pointers to 5 integers

b)

ptr is an array of 5 integers

c)

ptr is a pointer to an array of 5 integers

d)

ptr is a pointer to array

Q1.2

The function malloc() is declared in which header file.

a)

stdio.h

b)

stdlib.h

c)

conio.h

d)

iostream.h

Q1.3

What is the output of:
#include<stdio.h>
int main()
{
  char ch = 'Z';
  printf("%d ", ch);
  return 0;
}

a)

65

b)

90

c)

97

d)

122

Q1.4

How is an array initialized in C language?

a)

int a[3] = {1, 2, 3};

b)

int a = {1, 2, 3};

c)

int a [ ] = new int[3];

d)

int a(3) = {1, 2, 3};

Q1.5

What is the return type of the fopen() function in C?

a)

Pointer to a FILE object.

b)

Pointer to an integer.

c)

An integer.

d)

None of the above.

Q1.6

What will be the output of the following C Code?
#include<stdio.h>
int main()
{
  int x=4, y, z;
  y=--x;
  z=x--;
  printf("%d%d%d", x, y, z);
}

a)

3 2 3

b)

2 2 3

c)

3 2 2

d)

2 3 3

Q1.7

The keyword used to transfer control from a function back to the calling function is.

a)

switch

b)

return

c)

continue

d)

go to

Q1.8

What is the output of:
#include <stdio.h>
int main( )
{
  float a = 5, b = 2;
  int c,d;
  c = a/b;
  d = c/2;
  printf("%d", d);
  return 0;
}

a)

1

b)

0

c)

1.5

d)

1.25

Q1.9

In C, if you pass an array as an argument to a function, what actually gets passed?

a)

First element of the array

b)

Value of elements of the array

c)

Base address of the array

d)

Address of the last element of array

Q1.10

How is the $3^{rd}$ element in an array accessed based on pointer notation?

a)

*a+3

b)

*(a+3)

c)

*(*a+3)

d)

&(a+3)

Q.2 Solve both questions :

Q2.1

Explain entry controlled loop and exit controlled loop with flow charts and examples.

Q2.2

Write a C program to reverse a given multi-digit number.

Q.3 Solve both questions :

Q3.1

Explain break and continue keywords with suitable examples in context of managing loops.

Q3.2

What is storage classes in C. Write features (storage, default value, scope, life) of variables defined under each storage class.

Q.4 Solve both questions :

Q4.1

Write a C function for Bubble sort. Analyse the time complexity of Bubble sort for each standard cases.

Q4.2

Differentiate between formal argument and actual argument with an example.

Q.5 Solve both questions :

Q5.1

What is recursion? Write a recursive C program to generate $n^{th}$ term of the Fibonacci series.

Q5.2

How string is declared and initialized? Explain any four predefined string manipulation functions with examples.

Q.6 Solve both questions :

Q6.1

Write a C program to find result matrix after multiplying two given matrices using 2-D arrays.

Q6.2

Write a program to copy contents of one file to another. While doing so replace all lowercase characters to their equivalent uppercase characters.

Q.7 Solve both questions :

Q7.1

Write the difference between structure and union. Compare them with the help of an example.

Q7.2

Write a program to copy the contents of one array into another in reverse order.

Q.8 Solve both questions :

Q8.1

Differentiate between call-by-value and call-by-reference with suitable examples.

Q8.2

Discuss conditional operator? Write a C program to find largest of three numbers using conditional operator?

Q.9 Solve both questions :

Q9.1

Write a C program that converts a string like "124" to an integer 124.

Q9.2

Write a C program using the nesting of loops to print the following pattern:
      1
    2  3
  4  5  6
7  8  9  10


2022 V4 100104

B.Tech 1st Semester Exam-2022

Time 03 Hours
Full Marks 70
Instructions:
  • The marks are indicated in the right-hand margin.
  • There are NINE questions in this paper.
  • Attempt FIVE questions in all.
  • Question No. 1 is compulsory.

Q.1 Choose the correct answer of the following (any seven):

Q1.1

What does the following declaration mean?
int *ptr [5];

a)

ptr is an array of pointers to 5 integers

b)

ptr is an array of 5 integers

c)

ptr is a pointer to an array of 5 integers

d)

ptr is a pointer to array

Q1.2

The function malloc() is declared in which header file.

a)

stdio.h

b)

stdlib.h

c)

conio.h

d)

iostream.h

Q1.3

What is the output of:
#include<stdio.h>
int main()
{
  char ch = 'Z';
  printf("%d ", ch);
  return 0;
}

a)

65

b)

90

c)

97

d)

122

Q1.4

How is an array initialized in C language?

a)

int a[3] = {1, 2, 3};

b)

int a = {1, 2, 3};

c)

int a [ ] = new int[3];

d)

int a(3) = {1, 2, 3};

Q1.5

What is the return type of the fopen() function in C?

a)

Pointer to a FILE object.

b)

Pointer to an integer.

c)

An integer.

d)

None of the above.

Q1.6

What will be the output of the following C Code?
#include<stdio.h>
int main()
{
  int x=4, y, z;
  y=--x;
  z=x--;
  printf("%d%d%d", x, y, z);
}

a)

3 2 3

b)

2 2 3

c)

3 2 2

d)

2 3 3

Q1.7

The keyword used to transfer control from a function back to the calling function is.

a)

switch

b)

return

c)

continue

d)

go to

Q1.8

What is the output of:
#include <stdio.h>
int main( )
{
  float a = 5, b = 2;
  int c,d;
  c = a/b;
  d = c/2;
  printf("%d", d);
  return 0;
}

a)

1

b)

0

c)

1.5

d)

1.25

Q1.9

In C, if you pass an array as an argument to a function, what actually gets passed?

a)

First element of the array

b)

Value of elements of the array

c)

Base address of the array

d)

Address of the last element of array

Q1.10

How is the $3^{rd}$ element in an array accessed based on pointer notation?

a)

*a+3

b)

*(a+3)

c)

*(*a+3)

d)

&(a+3)

Q.2 Solve both questions :

Q2.1

Explain entry controlled loop and exit controlled loop with flow charts and examples.

Q2.2

Write a C program to reverse a given multi-digit number.

Q.3 Solve both questions :

Q3.1

Explain break and continue keywords with suitable examples in context of managing loops.

Q3.2

What is storage classes in C. Write features (storage, default value, scope, life) of variables defined under each storage class.

Q.4 Solve both questions :

Q4.1

Write a C function for Bubble sort. Analyse the time complexity of Bubble sort for each standard cases.

Q4.2

Differentiate between formal argument and actual argument with an example.

Q.5 Solve both questions :

Q5.1

What is recursion? Write a recursive C program to generate $n^{th}$ term of the Fibonacci series.

Q5.2

How string is declared and initialized? Explain any four predefined string manipulation functions with examples.

Q.6 Solve both questions :

Q6.1

Write a C program to find result matrix after multiplying two given matrices using 2-D arrays.

Q6.2

Write a program to copy contents of one file to another. While doing so replace all lowercase characters to their equivalent uppercase characters.

Q.7 Solve both questions :

Q7.1

Write the difference between structure and union. Compare them with the help of an example.

Q7.2

Write a program to copy the contents of one array into another in reverse order.

Q.8 Solve both questions :

Q8.1

Differentiate between call-by-value and call-by-reference with suitable examples.

Q8.2

Discuss conditional operator? Write a C program to find largest of three numbers using conditional operator?

Q.9 Solve both questions :

Q9.1

Write a C program that converts a string like "124" to an integer 124.

Q9.2

Write a C program using the nesting of loops to print the following pattern:
      1
    2  3
  4  5  6
7  8  9  10


2021 100204

B.Tech 2nd Semester Exam., 2021

Time 3 hours
Full Marks 70
Instructions:
  • The marks are indicated in the right-hand margin.
  • There are NINE questions in this paper.
  • Attempt FIVE questions in all.
  • Question No. 1 is compulsory.

  1. Choose the correct option (any seven) :

Q1.a

What will be the output of this C code?

#include<stdio.h>
int main()
{
    char ch = 'A';
    printf("%d", sizeof('A'));
    return 0;
}
a)

1

b)

2

c)

3

d)

4

Q1.b

What will be the output of this C code?

#include<stdio.h>
int main()
{
    extern int i;
    i = 20;
    printf("%d", i);
    return 0;
}
a)

20

b)

4

c)

Undefined reference to I

d)

Linking error

Q1.c

What will be the output of this C code?

#include<stdio.h>
int main()
{
    int i = 100;
    {
        int i = 0;
        printf("%d", i==0);
    }
    return 0;
}
a)

10

b)

0

c)

Garbage value

d)

1

Q1.d

What will be the output of this C code?

#include<stdio.h>
int main(){
    int x=3, y=4, z;
    z = ++x * y++;
    printf("%d", z);
}
a)

12

b)

16

c)

18

d)

20

Q1.e

In C, if you pass an array as an argument to a function, what actually gets passed?

a)

Value of elements in array

b)

First element of the array

c)

Base address of the array

d)

Address of the last element of array

Q1.f

The keyword used to transfer control from a function back to the calling function is

a)

switch

b)

goto

c)

go back

d)

return

Q1.g

What will be the output of this C code?

#include<stdio.h>
int main()
{
    int y=200;
    const int x=y;
    x=10;
    printf("%d\n", x);
    return 0;
}
a)

200

b)

Garbage value

c)

Error

d)

10

Q1.h

Which of the following are unary operators in C?

  1. !
  2. sizeof
  3. ~
  4. &&
a)

1, 2

b)

1, 3

c)

2, 4

d)

1, 2 and 3

Q1.i

How will you free the allocated memory?

a)

remove(var-name);

b)

free(var-name);

c)

delete(var-name);

d)

alloc(var-name);

Q1.j

Which statement will you add in the following program to work it correctly?

#include<stdio.h>
int main()
{
    printf("%f", log(128.0));
    return 0;
}
a)

#include<conio.h>

b)

#include<math.h>

c)

#include<stdlib.h>

d)

#include<maths.h>

Q2.a

Write a program to print all prime numbers from 1 to 100.

Q2.b

It is syntactically valid to use float variable as loop control variable but it is not recommended. Justify your answer regarding this statement.

Q3.a

Write a program to generate all combinations of 1, 2 and 3 using for loop.

Q3.b

Define data types in C. Discuss primitive data types in terms of memory occupied, format specifier and range.

Q4.1

Define calling and called functions with suitable examples. What do you mean by call-by-value and call-by-reference? Write C programs for swapping of two numbers using call-by-value and call-by-reference techniques.

Q5.a

Explain various types of arithmetic and logical operators in C language with the help of example. When precedence of two operators in an arithmetic expression is same, how associativity helps in identifying which operator will be evaluated first? Illustrate it with example.

Q5.b

Suppose that hundred numbers are entered from the keyboard into an array. The number to be searched is entered through the keyboard by the user. Write a program to find if the number to be searched is present in the array and if it is present, display the number of times it appears in the array.

Q6.a

What is case control structure in C? What is the reason for using break statement at the end of each case in case control block?

Q6.b

Explain pointer arithmetic with the help of suitable examples.

Q7.a

Any year is entered through the keyboard. Write a C program to determine whether the year is a leap year or not.

Q7.b

Explain string palindrome. Write a program in C to check whether a given string is palindrome or not.

Q8.a

Write a C program using the nesting of loops to print the following pattern :

    *
   * *
  * * *
 * * * *
* * * * *
Q8.b

Define storage classes with its type in detail.

Q9.a

What is recursive function? Further, for given integer n, write a program in C to find the sum of the following series using recursion :

$ S = 1 + 2 + 3 + \dots + n $

Q9.b

Define structure and union in C with suitable examples.


2020 100104

B.Tech 2nd Semester Special Exam., 2020

Time 3 hours
Full Marks 70
Instructions:
  • The marks are indicated in the right-hand margin.
  • There are NINE questions in this paper.
  • Attempt FIVE questions in all.
  • Question No. 1 is compulsory.

  1. Choose the correct alternative (any seven) :

Q1.a

A variable name in C should be a/an

a)

reserve word

b)

keyword

c)

identifier

d)

All of the above

Q1.b

Why do we write (int*) before malloc?

int *p = (int*) malloc(sizeof(int));

a)

It is for the syntax correctness

b)

It is for the type casting

c)

It is to inform malloc() function about data-type expected

d)

None of the above

Q1.c

Which header file is used for reading and writing to a file?

a)

#include<iostream.h>

b)

#include<fstream.h>

c)

#include<file.h>

d)

All of the above

Q1.d

Which of the following functions displays the keyboard character for pressed key?

a)

getch()

b)

getche()

c)

Both (i) and (ii)

d)

None of the above

Q1.e

What does the following declaration mean?

int (*ptr) [10];

a)

ptr is array of pointers to 10 integers

b)

ptr is a pointer to an array of 10 integers

c)

ptr is an array of 10 integers

d)

ptr is a pointer to array

Q1.f

Automatic variables are initialized to

a)

zero

b)

junk value

c)

None of the above

d)

Both of the above

Q1.g

Which of the following symbols is the type-specifier?

a)

&

b)
c)

d)

%

Q1.h

The && and || operators

a)

compare two numeric values

b)

compare two numeric values short-hand operators

c)

compare two Boolean values

d)

None of the above

Q1.i

Identify the correct sequence of steps to run a program.

a)

Link, load, code, compile and execute

b)

Code, compile, link, execute and load

c)

Code, compile, link, load and execute

d)

Compile, code, link, load and execute

Q1.j

An external variable is the one

a)

which resides in the memory till the end of the program

b)

which is globally accessible by all the functions

c)

which is declared outside the body of the function

d)

All of the above

Q2.a

Discuss about some methods or methodologies used for problem solving.

Q2.b

How programming utilizes different components of computer system?

Q2.c

What is algorithm? Give an example algorithm for any problem.

Q3.a

What is the difference between compilation and execution of a program?

Q3.b

What is the effect of warning and syntax error on program execution? What we get as an output of compilation step?

Q3.c

What are variables? List the 'data types' which can be associated to a variable in C language.

Q4.a

What is the role of 'header files' in C language? List any four with their usage.

Q4.b

Draw a flowchart to find the average of 10 numbers of an array.

Q4.c

Write the syntax for conditional operator in C. Also write the syntax for some conditional statements used in C.

Q5.a

List the looping constructs used in C. What are the roles of 'break' and 'continue' statements in loops? Show with examples.

Q5.b

Given a list of 11 numbers. Write a C program to find the median of that list.

Q6.a

What are functions? How are they useful? Comment on two categories in which various functions can be categorized.

Q6.b

Write a C program to generate Fibonacci series using function.

Q6.c

List three different ways to read a string from the prompt.

Q7.a

What are the ways of parameter passing in functions? Explain each.

Q7.b

Write a C program to find the largest number from an array using pointer.

Q7.c

What are the structures in C? How are they different from Union?

Q8.a

What is dynamic memory allocation? How is this achieved in C? Explain.

Q8.b

Write a C program to copy the content of one file into other.

Q8.c

How is merge sort different from other sorting algorithms?

Q9.a

Write a C program to create an array of structures named "STUDENT" with fields Name, Roll No, Address and Marks. Also add the code for inserting, deleting and printing any student record.

Q9.b

What do you mean by command line argument? Give an example.


2019 100104

B.Tech 1st Semester Exam., 2019 (New Course)

Time 3 hours
Full Marks 70
Instructions:
  • All questions carry equal marks.
  • There are NINE questions in this paper.
  • Attempt FIVE questions in all.
  • Question No. 1 is compulsory.

Q.1 Choose the correct answer from any seven of the following:

Q1.1

Let x be an integer which can take a value of 0 or 1. The statement if (x == 0)x = 1; else x = 0; is equivalent to which one of the following?

a)

x = 1 - x

b)

x = x + 1

c)

x = x * 1

d)

x = 1% x

Q1.2

A program attempts to generate as many permutations as possible of the string, 'abcd' by pushing the characters a, b, c, d in the same order onto a stack, but it may pop off the top character at any time. Which one of the following strings cannot be generated using this program?

a)

abcd

b)

dcba

c)

cabd

d)

cbad

Q1.3

Suppose a C program has floating constant 1.414, what is the best way to convert this 'float' data type?

a)

(float)1.414

b)

Float (1.414)

c)

1.414f or 1.414F

d)

1.414 itself of 'float' data type, i.e., nothing else required

Q1.4

What is the output of the following program?
void main(){
  int a;
  a=1;
  while(a<=1)
    if(a%2)
      printf("%d", a++);
    else
      printf("%d", ++a);
  printf("%d", a+10);
}

a)

011

b)

012

c)

111

d)

112

Q1.5

What is the output of this C code?
#include<stdio.h>
void main()
{
  int a = 5 * 3 + 2 - 4;
  printf("%d", a);
}

a)

13

b)

14

c)

12

d)

16

Q1.6

What is the output of this C code?
#include<stdio.h>
void main()
{
  int b = 6;
  int c = 7;
  int a = ++b+c--;
  printf("%d", a);
}

a)

Run-time error

b)

15

c)

13

d)

14

Q1.7

What is the output of this C code?
#include<stdio.h>
void foo(int*);
int main()
{
  int i = 10;
  foo((&i)++);
}
void foo(int* p)
{
  printf("%d ", *p);
}

a)

10

b)

some garbage value

c)

compile-time error

d)

segmentation fault/code crash

Q1.8

User-defined data type can be derived by

a)

struct

b)

enum

c)

typedef

d)

All of the above

Q1.9

As per C language standard, which of the following is/are not keyword(s)? Pick the best statement:
auto, make, main, sizeof, elseif

a)

make, main

b)

sizeof

c)

auto, make

d)

make, main, elseif

Q1.10

What is the output of this C code (when 1 is entered)?
#include<stdio.h>
void main()
{
  double ch;
  printf ("enter a value between 1 to 2:");
  scanf("%lf", &ch);
  switch (ch)
  {
    case 1:
      printf("1");
      break;
    case 2:
      printf("2");
      break;
  }
}

a)

Compile-time error

b)

1

c)

2

d)

None of the above

Q.2 Solve this question :

Q2.1

What do you mean by pre-processor? Also explain the use of %i format specifier w.r.t, scanf() function.

Q.3 Solve this question :

Q3.1

Write a C program to Perform binary search on a set of given sorted numbers.

Q.4 Solve this question :

Q4.1

Write a C program to find the number of lines in a text file.

Q.5 Solve this question :

Q5.1

Explain pointer arithmetic with the help of suitable diagrams.

Q.6 Solve this question :

Q6.1

Explain the following bitwise operators:
(a) Bitwise AND
(b) Bitwise OR
(c) Bitwise XOR
(d) Bitwise Left Shift

Q.7 Solve this question :

Q7.1

What do you mean by 'call by reference'? Explain with the help of a function which swaps two numbers.

Q.8 Solve this question :

Q8.1

Write a C program of the following:
(a) Reverse a string without using strrev().
(b) Concatenate two strings without using strcat()

Q.9 Solve this question :

Q9.1

Write a 'recursive' C program to print the following:
(a) GCD of two numbers
(b) Merge-sort of a set of given numbers


2019 V4 100104

B.Tech 1st Semester Exam., 2019 (New Course)

Time 3 hours
Full Marks 70
Instructions:
  • All questions carry equal marks.
  • There are NINE questions in this paper.
  • Attempt FIVE questions in all.
  • Question No. 1 is compulsory.

Q.1 Choose the correct answer from any seven of the following:

Q1.1

Let x be an integer which can take a value of 0 or 1. The statement if (x == 0)x = 1; else x = 0; is equivalent to which one of the following?

a)

x = 1 - x

b)

x = x + 1

c)

x = x * 1

d)

x = 1% x

Q1.2

A program attempts to generate as many permutations as possible of the string, 'abcd' by pushing the characters a, b, c, d in the same order onto a stack, but it may pop off the top character at any time. Which one of the following strings cannot be generated using this program?

a)

abcd

b)

dcba

c)

cabd

d)

cbad

Q1.3

Suppose a C program has floating constant 1.414, what is the best way to convert this 'float' data type?

a)

(float)1.414

b)

Float (1.414)

c)

1.414f or 1.414F

d)

1.414 itself of 'float' data type, i.e., nothing else required

Q1.4

What is the output of the following program?
void main(){
  int a;
  a=1;
  while(a<=1)
    if(a%2)
      printf("%d", a++);
    else
      printf("%d", ++a);
  printf("%d", a+10);
}

a)

011

b)

012

c)

111

d)

112

Q1.5

What is the output of this C code?
#include<stdio.h>
void main()
{
  int a = 5 * 3 + 2 - 4;
  printf("%d", a);
}

a)

13

b)

14

c)

12

d)

16

Q1.6

What is the output of this C code?
#include<stdio.h>
void main()
{
  int b = 6;
  int c = 7;
  int a = ++b+c--;
  printf("%d", a);
}

a)

Run-time error

b)

15

c)

13

d)

14

Q1.7

What is the output of this C code?
#include<stdio.h>
void foo(int*);
int main()
{
  int i = 10;
  foo((&i)++);
}
void foo(int* p)
{
  printf("%d ", *p);
}

a)

10

b)

some garbage value

c)

compile-time error

d)

segmentation fault/code crash

Q1.8

User-defined data type can be derived by

a)

struct

b)

enum

c)

typedef

d)

All of the above

Q1.9

As per C language standard, which of the following is/are not keyword(s)? Pick the best statement:
auto, make, main, sizeof, elseif

a)

make, main

b)

sizeof

c)

auto, make

d)

make, main, elseif

Q1.10

What is the output of this C code (when 1 is entered)?
#include<stdio.h>
void main()
{
  double ch;
  printf ("enter a value between 1 to 2:");
  scanf("%lf", &ch);
  switch (ch)
  {
    case 1:
      printf("1");
      break;
    case 2:
      printf("2");
      break;
  }
}

a)

Compile-time error

b)

1

c)

2

d)

None of the above

Q.2 Solve this question :

Q2.1

What do you mean by pre-processor? Also explain the use of %i format specifier w.r.t, scanf() function.

Q.3 Solve this question :

Q3.1

Write a C program to Perform binary search on a set of given sorted numbers.

Q.4 Solve this question :

Q4.1

Write a C program to find the number of lines in a text file.

Q.5 Solve this question :

Q5.1

Explain pointer arithmetic with the help of suitable diagrams.

Q.6 Solve this question :

Q6.1

Explain the following bitwise operators:
(a) Bitwise AND
(b) Bitwise OR
(c) Bitwise XOR
(d) Bitwise Left Shift

Q.7 Solve this question :

Q7.1

What do you mean by 'call by reference'? Explain with the help of a function which swaps two numbers.

Q.8 Solve this question :

Q8.1

Write a C program of the following:
(a) Reverse a string without using strrev().
(b) Concatenate two strings without using strcat()

Q.9 Solve this question :

Q9.1

Write a 'recursive' C program to print the following:
(a) GCD of two numbers
(b) Merge-sort of a set of given numbers


2019 100204

B.Tech 2nd Semester Exam., 2019 (New Course)

Time 3 hours
Full Marks 70
Instructions:
  • The marks are indicated in the right-hand margin.
  • There are NINE questions in this paper.
  • Attempt FIVE questions in all.
  • Question No. 1 is compulsory.

Q.1 Choose the correct alternative (any seven):

Q1.1

What will be the data type of result of the following operation?
(float)a * (int)b/(long)c * (double)d)

a)

int

b)

long

c)

float

d)

double

Q1.2

What does the following declaration mean?
int (*ptr) [10];

a)

ptr is array of pointers to 10 integers

b)

ptr is a pointer to an array of 10 integers

c)

ptr is an array of 10 integers

d)

ptr is a pointer to array

Q1.3

Which of the following is a correct format for declaration of function?

a)

return-type function-name (argument type);

b)

return-type function-name (argument type) {}

c)

return-type (argument type) function-name;

d)

All of the above

Q1.4

The value obtained in the function is given back to main by using ______ keyword.

a)

return

b)

static

c)

new

d)

volatile

Q1.5

Which data type is most suitable for storing a number 65000 in a 32-bit system?

a)

signed short

b)

unsigned short

c)

long

d)

int

Q1.6

Which of the following declarations is not supported by C?

a)

String str;

b)

Char *str;

c)

Float str = 3e2;

d)

None of the above

Q1.7

Which of the following is an invalid if-else statement?

a)

if (if (i == 1)) {}

b)

if (func1 (a)) {}

c)

if (a) {}

d)

if ((char) a) {}

Q1.8

A local variable declaration with no storage class specified is by default

a)

auto

b)

extern

c)

static

d)

register

Q1.9

Automatic variables are initialized to

a)

zero

b)

junk value

c)

None of the above

d)

Both (i) and (ii)

Q1.10

The getchar() function is defined in ______ header file.

a)

conio.h

b)

stdio.h

c)

iostream.h

d)

None of the above

Q.2 Solve all parts :

Q2.1

What do you understand by the term 'problem solving'? How can programming be used to do problem solving?

Q2.2

Discuss about the components of computer system. How are they involved in computer programming activity?

Q2.3

Write the algorithm for exchanging the values of two variables.

Q.3 Solve all parts :

Q3.1

Differentiate between flowchart, pseudo-code and source code.

Q3.2

What are the outcomes of compilation of a program? Discuss in detail.

Q3.3

What are constants? List the types of constants as defined in C language.

Q.4 Solve all parts :

Q4.1

What are the libraries? How are they different from header files?

Q4.2

What is an array? Write a C program to find the average of 10 numbers of an array.

Q4.3

What do you understand by the operator precedence? Explain.

Q.5 Solve both questions :

Q5.1

Define storage classes of C with some appropriate examples.

Q5.2

What is branching? What are the possible types of branching and the C statements used for such type of branching? Give a detailed explanation with example.

Q.6 Solve both questions :

Q6.1

Write a C program to calculate 12!/8. The operation is factorial of 12, divided by 8. Also comment by examine whether the algorithm used is efficient.

Q6.2

What is type casting? Explain its classification through examples.

Q.7 Solve all parts :

Q7.1

Give the purpose, proper syntax and other variants of 'getch()' and 'gets()' functions.

Q7.2

How can an array of numbers be passed to function as parameter? Write an example C program in support.

Q7.3

What is dynamic memory allocation in C?

Q.8 Solve both questions :

Q8.1

Differentiate between the following:
(i) Structures and Union
(ii) Formatted and Unformatted data files

Q8.2

What is a file? List different operations performed on file. How are they achieved? Explain.

Q.9 Solve all parts :

Q9.1

Write a C program to create an array of structures named "STUDENT" with fields, Name, Cell no, Address, and Marks. How to show any student record using this structure?

Q9.2

Which of the sorting algorithm is better than other and why? Explain.

Q9.3

Write C program for merge sort algorithm.


2019 V4 100204

B.Tech 2nd Semester Exam., 2019 (New Course)

Time 3 hours
Full Marks 70
Instructions:
  • The marks are indicated in the right-hand margin.
  • There are NINE questions in this paper.
  • Attempt FIVE questions in all.
  • Question No. 1 is compulsory.

Q.1 Choose the correct alternative (any seven):

Q1.1

What will be the data type of result of the following operation?
(float)a * (int)b/(long)c * (double)d)

a)

int

b)

long

c)

float

d)

double

Q1.2

What does the following declaration mean?
int (*ptr) [10];

a)

ptr is array of pointers to 10 integers

b)

ptr is a pointer to an array of 10 integers

c)

ptr is an array of 10 integers

d)

ptr is a pointer to array

Q1.3

Which of the following is a correct format for declaration of function?

a)

return-type function-name (argument type);

b)

return-type function-name (argument type) {}

c)

return-type (argument type) function-name;

d)

All of the above

Q1.4

The value obtained in the function is given back to main by using ______ keyword.

a)

return

b)

static

c)

new

d)

volatile

Q1.5

Which data type is most suitable for storing a number 65000 in a 32-bit system?

a)

signed short

b)

unsigned short

c)

long

d)

int

Q1.6

Which of the following declarations is not supported by C?

a)

String str;

b)

Char *str;

c)

Float str = 3e2;

d)

None of the above

Q1.7

Which of the following is an invalid if-else statement?

a)

if (if (i == 1)) {}

b)

if (func1 (a)) {}

c)

if (a) {}

d)

if ((char) a) {}

Q1.8

A local variable declaration with no storage class specified is by default

a)

auto

b)

extern

c)

static

d)

register

Q1.9

Automatic variables are initialized to

a)

zero

b)

junk value

c)

None of the above

d)

Both (i) and (ii)

Q1.10

The getchar() function is defined in ______ header file.

a)

conio.h

b)

stdio.h

c)

iostream.h

d)

None of the above

Q.2 Solve all parts :

Q2.1

What do you understand by the term 'problem solving'? How can programming be used to do problem solving?

Q2.2

Discuss about the components of computer system. How are they involved in computer programming activity?

Q2.3

Write the algorithm for exchanging the values of two variables.

Q.3 Solve all parts :

Q3.1

Differentiate between flowchart, pseudo-code and source code.

Q3.2

What are the outcomes of compilation of a program? Discuss in detail.

Q3.3

What are constants? List the types of constants as defined in C language.

Q.4 Solve all parts :

Q4.1

What are the libraries? How are they different from header files?

Q4.2

What is an array? Write a C program to find the average of 10 numbers of an array.

Q4.3

What do you understand by the operator precedence? Explain.

Q.5 Solve both questions :

Q5.1

Define storage classes of C with some appropriate examples.

Q5.2

What is branching? What are the possible types of branching and the C statements used for such type of branching? Give a detailed explanation with example.

Q.6 Solve both questions :

Q6.1

Write a C program to calculate 12!/8. The operation is factorial of 12, divided by 8. Also comment by examine whether the algorithm used is efficient.

Q6.2

What is type casting? Explain its classification through examples.

Q.7 Solve all parts :

Q7.1

Give the purpose, proper syntax and other variants of 'getch()' and 'gets()' functions.

Q7.2

How can an array of numbers be passed to function as parameter? Write an example C program in support.

Q7.3

What is dynamic memory allocation in C?

Q.8 Solve both questions :

Q8.1

Differentiate between the following:
(i) Structures and Union
(ii) Formatted and Unformatted data files

Q8.2

What is a file? List different operations performed on file. How are they achieved? Explain.

Q.9 Solve all parts :

Q9.1

Write a C program to create an array of structures named "STUDENT" with fields, Name, Cell no, Address, and Marks. How to show any student record using this structure?

Q9.2

Which of the sorting algorithm is better than other and why? Explain.

Q9.3

Write C program for merge sort algorithm.


2018 100104

B.Tech 1st Semester Exam., 2018 (New)

Time 3 hours
Full Marks 70
Instructions:
  • All questions carry equal marks.
  • There are NINE questions in this paper.
  • Attempt FIVE questions in all.
  • Question No. 1 is compulsory.

Q.1 Choose the correct answer (any seven):

Q1.1

Which of these, best describes an array?

a)

A data structure that shows a hierarchical behaviour

b)

Container of objects of similar types

c)

Container of objects of mixed types

d)

All of the above

Q1.2

How do you initialize an array in C?

a)

int arr[3] = (1,2,3);

b)

int arr(3) = {1,2,3};

c)

int arr[3] = {1,2,3};

d)

int arr(3) = (1,2,3);

Q1.3

When does the segmentation fault occur?

a)

Compile-time

b)

Run-time

c)

Both of the above

d)

None of the above

Q1.4

What is the output of the following program?
void main(){
  int a;
  a=1;
  while(a<=1)
    if(a%2)
      printf("%d", a++);
    else
      printf("%d", ++a);
  printf("%d", a+10);
}

a)

011

b)

012

c)

111

d)

112

Q1.5

What is the output of the following code?
void main()
{
  int i;
  i=0;
  if(i=15,10,5)
    printf("Programming %d",i);
  else
    printf("Skills %d",i);
  getch();
}

a)

Skills 15

b)

Programming 5

c)

Programming 15

d)

Skills 5

Q1.6

What will be printed as the result of the operation below?
main()
{
  char s1[]="Cisco";
  char s2[]="systems";
  printf ("%s", s1);
}

a)

System

b)

error

c)

Cisco

d)

Compilation fail

Q1.7

Process of inserting an element in stack is called

a)

create

b)

push

c)

evaluation

d)

Pop

Q1.8

Consider the following segment of C-code:
int j, n;
j=1;
while (j<=n)
  j=j*2;
The number of comparisons made in the execution of the loop for any n>0 is: (Base of log is 2 in all options)

a)

CEIL(log n)

b)

CEIL(log n)+2

c)

FLOOR(log n)+2

d)

n

Q1.9

The minimum number of comparisons required to find the minimum and the maximum of 100 numbers is

a)

100

b)

200

c)

150

d)

148

Q1.10

What is the output of following program?
#include <stdio.h>
int main()
{
  int a=1;
  int b=1;
  int c=a || --b;
  int d=a-- && --b;
  printf("a=%d, b=%d, c=%d, d=%d", a, b, c, d);
  return 0;
}

a)

a = 0, b = 1, c = 1, d = 0

b)

a = 0, b = 0, c = 1, d = 0

c)

a = 1, b = 1, c = 1, d = 1

d)

a = 0, b = 0, c = 0, d = 0

Q.2 Solve this question :

Q2.1

How array and pointers are related? Explain with the help of suitable diagrams.

Q.3 Solve both questions :

Q3.1

Write a C program to count the number lines input by the user.

Q3.2

Explain the difference between call by reference and call by value with the help of a suitable example.

Q.4 Solve this question :

Q4.1

With the help of an example, differentiate between static and dynamic memory allocations.

Q.5 Solve this question :

Q5.1

What are library functions and their users in C language? Can we write our own functions and include them in C library?

Q.6 Solve both questions :

Q6.1

Write a "recursive" C program to print—
(a) Fibonacci series;
(b) factorial of a given number.

Q.7 Solve this question :

Q7.1

Write the differences between structure and union. Compare them with the help of an example.

Q.8 Solve this question :

Q8.1

Write a C program to convert an infix expression into postfix expression. In particular, an infix expression: $(1-2)*(4+5)$ will have postfix expression: $12-45+*$.

Q.9 Solve this question :

Q9.1

Write a C program to illustrate reading of data from a file.


2018 V4 100104

B.Tech 1st Semester Exam., 2018 (New)

Time 3 hours
Full Marks 70
Instructions:
  • All questions carry equal marks.
  • There are NINE questions in this paper.
  • Attempt FIVE questions in all.
  • Question No. 1 is compulsory.

Q.1 Choose the correct answer (any seven):

Q1.1

Which of these, best describes an array?

a)

A data structure that shows a hierarchical behaviour

b)

Container of objects of similar types

c)

Container of objects of mixed types

d)

All of the above

Q1.2

How do you initialize an array in C?

a)

int arr[3] = (1,2,3);

b)

int arr(3) = {1,2,3};

c)

int arr[3] = {1,2,3};

d)

int arr(3) = (1,2,3);

Q1.3

When does the segmentation fault occur?

a)

Compile-time

b)

Run-time

c)

Both of the above

d)

None of the above

Q1.4

What is the output of the following program?
void main(){
  int a;
  a=1;
  while(a<=1)
    if(a%2)
      printf("%d", a++);
    else
      printf("%d", ++a);
  printf("%d", a+10);
}

a)

011

b)

012

c)

111

d)

112

Q1.5

What is the output of the following code?
void main()
{
  int i;
  i=0;
  if(i=15,10,5)
    printf("Programming %d",i);
  else
    printf("Skills %d",i);
  getch();
}

a)

Skills 15

b)

Programming 5

c)

Programming 15

d)

Skills 5

Q1.6

What will be printed as the result of the operation below?
main()
{
  char s1[]="Cisco";
  char s2[]="systems";
  printf ("%s", s1);
}

a)

System

b)

error

c)

Cisco

d)

Compilation fail

Q1.7

Process of inserting an element in stack is called

a)

create

b)

push

c)

evaluation

d)

Pop

Q1.8

Consider the following segment of C-code:
int j, n;
j=1;
while (j<=n)
  j=j*2;
The number of comparisons made in the execution of the loop for any n>0 is: (Base of log is 2 in all options)

a)

CEIL(log n)

b)

CEIL(log n)+2

c)

FLOOR(log n)+2

d)

n

Q1.9

The minimum number of comparisons required to find the minimum and the maximum of 100 numbers is

a)

100

b)

200

c)

150

d)

148

Q1.10

What is the output of following program?
#include <stdio.h>
int main()
{
  int a=1;
  int b=1;
  int c=a || --b;
  int d=a-- && --b;
  printf("a=%d, b=%d, c=%d, d=%d", a, b, c, d);
  return 0;
}

a)

a = 0, b = 1, c = 1, d = 0

b)

a = 0, b = 0, c = 1, d = 0

c)

a = 1, b = 1, c = 1, d = 1

d)

a = 0, b = 0, c = 0, d = 0

Q.2 Solve this question :

Q2.1

How array and pointers are related? Explain with the help of suitable diagrams.

Q.3 Solve both questions :

Q3.1

Write a C program to count the number lines input by the user.

Q3.2

Explain the difference between call by reference and call by value with the help of a suitable example.

Q.4 Solve this question :

Q4.1

With the help of an example, differentiate between static and dynamic memory allocations.

Q.5 Solve this question :

Q5.1

What are library functions and their users in C language? Can we write our own functions and include them in C library?

Q.6 Solve both questions :

Q6.1

Write a "recursive" C program to print—
(a) Fibonacci series;
(b) factorial of a given number.

Q.7 Solve this question :

Q7.1

Write the differences between structure and union. Compare them with the help of an example.

Q.8 Solve this question :

Q8.1

Write a C program to convert an infix expression into postfix expression. In particular, an infix expression: $(1-2)*(4+5)$ will have postfix expression: $12-45+*$.

Q.9 Solve this question :

Q9.1

Write a C program to illustrate reading of data from a file.


Install on iOS

To install BEU Connect on your iPhone:

1. Tap the Share button at the bottom of Safari.
2. Scroll down and tap "Add to Home Screen".