Jawaharlal Nehru Technological University Hyderabad
Jawaharlal Nehru Technological University Hyderabad B.Tech I COMPUTER PROGRAMMING IN C Previous Question Paper (September/October - 2021 - R16)
Answer any five questions. All questions carry equal marks.
Main
Describe various number systems.
Answer
Number systems are techniques to represent numbers in a computer architecture. The primary systems are:
- Decimal Number System: Base 10 system using digits 0-9. It is the standard system for human communication.
- Binary Number System: Base 2 system using digits 0 and 1. It is the fundamental language of digital computers, where bits represent the presence or absence of electrical signals.
- Octal Number System: Base 8 system using digits 0-7. It is often used as a shorthand for binary, as each octal digit represents exactly three binary bits.
- Hexadecimal Number System: Base 16 system using digits 0-9 and letters A-F (representing 10-15). It is widely used in low-level programming and memory addressing because it represents four binary bits per digit, making it more compact than binary.
Draw a flowchart for finding first N prime numbers.
Answer
The flowchart for finding the first N prime numbers follows these logical steps:
- Start.
- Read the input N (number of primes required).
- Initialize count = 0 (number of primes found) and num = 2 (the first candidate number).
- Check if count is less than N. If no, go to Stop.
- If yes, check if num is prime:
- Initialize divisor = 2 and flag = true.
- While divisor is less than or equal to the square root of num:
- If num modulo divisor is 0, set flag = false and break.
- Increment divisor.
- If flag is true, print num and increment count.
- Increment num by 1 and return to step 4.
- Stop.
Discuss various applications of arrays.
Answer
Sign in to view the complete answer paper.
Write a program to read two matrices [m × p with p × n] multiply and display the result [m × n] in matrix form.
Answer
Sign in to view the complete answer paper.
Is dynamic memory management possible without pointers? Justify your answer.
Answer
Sign in to view the complete answer paper.
What operators are applicable to pointers? Why is the restriction?
Answer
Sign in to view the complete answer paper.
With an example explain the benefit of union over structure.
Answer
Sign in to view the complete answer paper.
Write a program to demonstrate command line arguments.
Answer
Sign in to view the complete answer paper.
Write a program to perform find and replace activity on the content of a file. Read file name, string1 and string2 as command line arguments. Find String1 in the given file and replace it with String2.
Answer
Sign in to view the complete answer paper.
Explain about fseek and ftell functions with an example.
Answer
Sign in to view the complete answer paper.
Explain about switch statement.
Answer
Sign in to view the complete answer paper.
Explain about the storage classes with an example.
Answer
Sign in to view the complete answer paper.
Discuss about logical and bitwise operators in C.
Answer
Sign in to view the complete answer paper.
Explain about the array of pointers with an example.
Answer
Sign in to view the complete answer paper.
Write a program for implementation of pointers to pointers.
Answer
Sign in to view the complete answer paper.
Differentiate between text and binary files with an example.
Answer
Sign in to view the complete answer paper.
Explain the self referential structures with an example.
Answer
Sign in to view the complete answer paper.