JAWAHARLAL NEHRU TECHNOLOGICAL UNIVERSITY HYDERABAD

JAWAHARLAL NEHRU TECHNOLOGICAL UNIVERSITY HYDERABAD B.Tech I Year PROGRAMMING FOR PROBLEM SOLVING Previous Question Paper (June - 2022 - R18)

B.Tech | I Year | I Semester | R18 | June - 2022

Answer PaperPaper Code: 151ACMaximum Marks: 75Time: 3 Hours

Answer any five questions

All questions carry equal marks

Main

115 marks
a

What is computer memory? Explain about primary and secondary memory.

7 marks

Answer

Computer memory is the electronic storage space in a computer where data and instructions are held for processing. It is categorized based on its accessibility, speed, and volatility.

Primary Memory: Also known as main memory, it is directly accessible by the CPU. It is volatile, meaning data is lost when power is turned off. Examples include RAM (Random Access Memory), which stores currently running programs, and ROM (Read-Only Memory), which stores essential boot-up instructions.

Secondary Memory: This is non-volatile storage used for long-term data retention. It is slower than primary memory but offers much larger capacity. Data is not lost when the computer is powered down. Examples include Hard Disk Drives (HDD), Solid State Drives (SSD), USB flash drives, and optical discs.

b

Explain different type conversion techniques with examples.

8 marks

Answer

Type conversion is the process of converting a value from one data type to another. It is classified into two main types:

1. Implicit Type Conversion (Type Promotion): This is performed automatically by the compiler when compatible data types are mixed in an expression. The smaller data type is promoted to the larger data type to prevent data loss.

int a = 10; float b = 5.5; float result = a + b; // 'a' is implicitly converted to float

2. Explicit Type Conversion (Type Casting): This is performed manually by the programmer using the cast operator. It is necessary when converting a larger data type to a smaller one, which may result in data truncation.

double x = 9.78; int y = (int)x; // 'x' is explicitly cast to int, resulting in y = 9

Explicit casting allows the programmer to force a conversion, providing control over how data is interpreted, whereas implicit conversion ensures safety during arithmetic operations between different numeric types.

215 marks
a

Write a C program to check whether the given number is prime or not.

7 marks

Answer

Sign in to view the complete answer paper.

b

Illustrate various forms of if statements with syntax and examples.

8 marks

Answer

Sign in to view the complete answer paper.

315 marks
a

What is an array? Describe declaration and initialization of one and two dimensional arrays with examples.

7 marks

Answer

Sign in to view the complete answer paper.

b

Discuss basic string functions available in C with examples.

8 marks

Answer

Sign in to view the complete answer paper.

415 marks
a

What is a structure? Explain defining and initializing a structure with example.

7 marks

Answer

Sign in to view the complete answer paper.

b

What is a pointer? Write a C program to find sum of all elements in an array using a pointer.

8 marks

Answer

Sign in to view the complete answer paper.

515 marks
a

Differentiate between text and binary files?

5 marks

Answer

Sign in to view the complete answer paper.

b

A file named DATA contains a series of integer numbers. Write a C program to read these numbers and then write all ‘even’ numbers to a file called EVEN and all ‘odd’ numbers to a file called ODD and then finally print the contents of these two files.

10 marks

Answer

Sign in to view the complete answer paper.

615 marks
a

Explain various dynamic memory allocation functions with examples.

7 marks

Answer

Sign in to view the complete answer paper.

b

Discuss call by value and call by reference with example programs.

8 marks

Answer

Sign in to view the complete answer paper.

715 marks
a

Explain commonly used preprocessor commands like include and define with example programs.

7 marks

Answer

Sign in to view the complete answer paper.

b

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

8 marks

Answer

Sign in to view the complete answer paper.

815 marks
a

Write an algorithm to find the roots of a quadratic equation.

7 marks

Answer

Sign in to view the complete answer paper.

b

Write a C program for selection sort.

8 marks

Answer

Sign in to view the complete answer paper.

About this paper

This page contains the question paper of PROGRAMMING FOR PROBLEM SOLVING from JAWAHARLAL NEHRU TECHNOLOGICAL UNIVERSITY HYDERABAD for B.Tech AE I Year I Semester, June - 2022, R18.

For the solved question paper with answers, switch to the Answer Paper tab.

Other papers in PROGRAMMING FOR PROBLEM SOLVING

Loading Question Papers

Fetching data from database...