JAWAHARLAL NEHRU TECHNOLOGICAL UNIVERSITY HYDERABAD
JAWAHARLAL NEHRU TECHNOLOGICAL UNIVERSITY HYDERABAD B.Tech I Year PROGRAMMING FOR PROBLEM SOLVING Previous Question Paper (June - 2022 - R18)
Answer any five questions
All questions carry equal marks
Main
What is computer memory? Explain about primary and secondary memory.
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.
Explain different type conversion techniques with examples.
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.
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.
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.
Write a C program to check whether the given number is prime or not.
Answer
Sign in to view the complete answer paper.
Illustrate various forms of if statements with syntax and examples.
Answer
Sign in to view the complete answer paper.
What is an array? Describe declaration and initialization of one and two dimensional arrays with examples.
Answer
Sign in to view the complete answer paper.
Discuss basic string functions available in C with examples.
Answer
Sign in to view the complete answer paper.
What is a structure? Explain defining and initializing a structure with example.
Answer
Sign in to view the complete answer paper.
What is a pointer? Write a C program to find sum of all elements in an array using a pointer.
Answer
Sign in to view the complete answer paper.
Differentiate between text and binary files?
Answer
Sign in to view the complete answer paper.
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.
Answer
Sign in to view the complete answer paper.
Explain various dynamic memory allocation functions with examples.
Answer
Sign in to view the complete answer paper.
Discuss call by value and call by reference with example programs.
Answer
Sign in to view the complete answer paper.
Explain commonly used preprocessor commands like include and define with example programs.
Answer
Sign in to view the complete answer paper.
Write a C program to find factorial of a given number using recursion.
Answer
Sign in to view the complete answer paper.
Write an algorithm to find the roots of a quadratic equation.
Answer
Sign in to view the complete answer paper.
Write a C program for selection sort.
Answer
Sign in to view the complete answer paper.