Sample Question Pper 1

Download as txt, pdf, or txt
Download as txt, pdf, or txt
You are on page 1of 2

Unit I: Introduction to Computer and Programming Concepts (20 Marks)

(5 Marks)
Define the following terms:

CPU
Memory Unit
I/O Units
Memory Hierarchy
Operating System
(5 Marks)
Explain the basic number system representations in computing. Discuss how binary,
octal, decimal, and hexadecimal number systems are related. Convert the decimal
number 42 into binary, octal, and hexadecimal.

(5 Marks)
What are the steps involved in problem-solving approaches? Explain the significance
of algorithms, flowcharts, and pseudocode in problem-solving. Illustrate with an
example.

(5 Marks)
Discuss the design and analysis of algorithms. Explain Time Complexity and Space
Complexity analysis with examples.

Unit II: Basics of C (20 Marks)


(4 Marks)
What is a Keyword in C? List five keywords and explain their usage.

(6 Marks)
Write a C program to perform the following:

Input two integers.


Perform addition, subtraction, multiplication, and division operations.
Output the result in decimal, octal, and hexadecimal formats.
(5 Marks)
Discuss the control structures in C with suitable examples of each:

If-else
Switch-case
Loops (for, while, do-while)
(5 Marks)
What is type casting in C? Explain the difference between implicit and explicit
type casting with examples. Also, describe the role of storage classes in C.

Unit III: Arrays and Pointers (15 Marks)


(6 Marks)
a) Write a C program to reverse a given one-dimensional array.
b) Write a program to find the largest element in a two-dimensional array.

(4 Marks)
Explain the concept of pointer arithmetic in C. Illustrate with an example of
accessing array elements using pointers.

(5 Marks)
a) What is dynamic memory allocation in C? Explain malloc(), calloc(), realloc(),
and free() with an example.
b) How would you use pointers in C to manipulate a string?

Unit IV: Functions (10 Marks)


(5 Marks)
Define a function in C. What is the difference between formal and actual arguments?
Explain with an example of a value-returning function.

(5 Marks)
Write a C program to compute the Fibonacci series using both iteration and
recursion.

Unit V: User-defined Data Types and File Handling (15 Marks)


(6 Marks)
a) What is a structure in C? Explain how a structure is defined and accessed.
b) Write a C program to create a student structure that contains the following
fields:
Name
Roll number
Marks Then, input details for five students and display them.
(6 Marks)
a) What is a union in C? Explain how it differs from a structure with an example.
b) Write a C program to demonstrate the use of unions.

(3 Marks)
Describe file handling in C. Write a C program to open a file, write data to it,
and then close the file.

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy