0% found this document useful (0 votes)
32 views2 pages

C Programming Exam Questions and Guidelines

This document outlines the supplementary summer examination details for the B.Tech course on Programming for Problem Solving at Dr. Babasaheb Ambedkar Technological University. It includes instructions for students, a breakdown of questions with marks allocation, and various topics to be covered in the exam. The exam is scheduled for July 24, 2025, with a maximum score of 60 marks.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
32 views2 pages

C Programming Exam Questions and Guidelines

This document outlines the supplementary summer examination details for the B.Tech course on Programming for Problem Solving at Dr. Babasaheb Ambedkar Technological University. It includes instructions for students, a breakdown of questions with marks allocation, and various topics to be covered in the exam. The exam is scheduled for July 24, 2025, with a maximum score of 60 marks.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

DR.

BABASAHEB AMBEDKAR TECHNOLOGICAL UNIVERSITY, LONERE


Supplementary Summer Examination – 2025
Course: [Link] (Common to All) Semester : II
Subject Code & Name: Programming for Problem Solving (24AF1000ES106)
Max Marks: 60 Date: 24th July 2025 Duration: 3 Hr.
Instructions to the Students:
1 Each question carries 12 marks.
2 Question No. 1 will be compulsory and include objective-type questions.
3 Candidates are required to attempt any four questions from Question No. 2 to
Question No. 6.
4 The level of question/expected answer as per OBE or the Course Outcome (CO) on
which the question is based is mentioned in ( ) in front of the question.
5 Use of non-programmable scientific calculators is allowed.
6 Assume suitable data wherever necessary and mention it clearly.
Marks

Q. 1 Objective type questions. (Compulsory Question) 12


Which of the following is a system software?
1 1
a) Microsoft Word b) Tally c) Turbo C++ d) Operating System
Which of the following is used for type casting in C?
2 1
a) #define b) (data_type) c) & d) @
Which of the following is a relational operator in C?
3 1
a) && b) || c) == d) =
Which keyword is used to jump to a labeled statement in C?
4 1
a) goto b) jump c) switch d) case
Which of the following denotes the address of a variable in C?
5 1
a) * b) && c) & d) @
Which operator is used for bitwise AND operation?
6 1
a) && b) || c) & d) ^
Which of the following loop runs at least once even if the condition is false?
7 1
a) while b) for c) do-while d) switch
What will *(ptr + 2) integer array?
8 a) Address of third element b) Value of third element 1
c) First element d) Size of array
What is the size of int in C on a 32-bit system?
9 a) 8 bytes b) 4 bytes c) 2 bytes d) 1 byte 1

Which type of memory is volatile and loses data when power is turned off?
10 1
a) Hard Disk b) ROM c) RAM d) Pen Drive
Which function returns control to the calling function in C?
11 1
a) break b) return c) exit() d) continue
What is the output of 10 % 3 in C?
12 1
a) 0 b) 1 c) 3 d) 1
Q. 2 Solve the following. 12
A) List and describe the various generations of computers. 6
B) Explain the role of input and output devices in a computer system with suitable examples. 6

Q.3 Solve the following. 12


A) Explain operator precedence and associativity in C with an example. 6
B) Define C tokens. List different types of tokens used in C. 6

Q. 4 Solve Any Two of the following. 12


A) Explain the difference between break, continue, and goto statements with examples. 6
B) List and define and write syntax for different types of loops used in C programming. 6
C) Create a user-defined function to calculate the factorial of a number. 6

Q.5 Solve Any Two of the following. 12


Explain the difference between one-dimensional and two-dimensional arrays with syntax
A) 6
and examples.
B) Write a C program to find the average of 10 numbers using arrays. 6
C) Compare the use of arrays and pointers for data manipulation in terms of efficiency. 6

Q. 6 Solve Any Two of the following. 12


A) What are structures in C? List the steps to declare and initialize a structure with syntax. 6
B) Explain with syntax different file handling modes in C. 6
C) Write a C program to input and display details of a student using structures. 6
*** End ***

Common questions

Powered by AI

In C, operator precedence determines the order in which operators are evaluated in expressions. Operators with higher precedence are evaluated before operators with lower precedence. Associativity determines the order of evaluation for operators of the same precedence level. For example, in the expression '3 + 2 * 5', the multiplication operator (*) has higher precedence than the addition operator (+), so the expression is evaluated as '3 + (2 * 5)' resulting in 13. If operators have the same precedence, associativity rules apply. For instance, the operators '+' and '-' are left-associative, so '10 - 5 + 3' is evaluated as '(10 - 5) + 3' .

The 'break' statement in C exits the nearest enclosing loop or switch statement immediately, effectively terminating the loop/switch. The 'continue' statement skips the rest of the code inside the current loop iteration and jumps to the next iteration of the loop. Contrastingly, the 'goto' statement allows for an unconditional jump to the labeled statement specified in the program, which can lead to a less structured flow of control if not used carefully. These statements are used to alter the normal sequence of execution in a program .

C tokens are the smallest individual units in a C program used for constructing statements. The commonly used types of tokens in C include keywords (e.g., int, return), identifiers (e.g., variable names), constants (e.g., numerical literals), strings (e.g., "Hello World"), operators (e.g., +, -), and punctuation symbols (e.g., ",", ";"). These tokens serve as the building blocks for C programming and are essential for understanding and writing correct syntax .

One-dimensional arrays in C are linear lists of a specific data type, declared with a single set of square brackets indicating the number of elements. For instance, 'int arr[5];' declares a one-dimensional array of integers. Two-dimensional arrays, in contrast, are like arrays of arrays, declared with two sets of square brackets, representing rows and columns. For example, 'int matrix[3][4];' declares a two-dimensional array. While one-dimensional arrays are used for simple data lists, two-dimensional arrays are suitable for data represented in tabular form, such as matrices .

System software refers to programs designed to manage and control computer hardware, providing a platform for application software. Examples include operating systems, compilers, and device drivers. Application software, such as Microsoft Word, is designed to help users perform specific tasks like word processing. While system software serves as an interface between hardware and user applications to ensure the system functions smoothly, application software directly facilitates user-oriented tasks .

C provides several file handling modes to control how a file is accessed within a program. Common modes include 'r' (read), 'w' (write), 'a' (append), 'r+' (read and write), 'w+' (write and read), and 'a+' (append and read). Each mode determines the operations allowed on the file and, in some cases, what happens to existing data. For example, 'r' opens an existing file for reading, 'w' creates a file or truncates the existing file to zero length for writing, and 'a' opens a file for appending at the end. Syntax for opening a file: 'FILE *fp = fopen("file.txt", "r");' .

Arrays in C are collections of data items of the same type, stored in contiguous memory locations, which allows for simple iteration and indexing through subscripting. Pointers, on the other hand, are variables that store memory addresses and can be used to dynamically manipulate data and allocate memory. From an efficiency standpoint, pointers can be more flexible, allowing for dynamic programming techniques, lower memory usage through dynamic allocation, and efficient manipulation of data with direct memory access. However, improper use of pointers can lead to memory leaks and segmentation faults. Conversely, arrays offer simplicity and safety but lack flexibility compared with pointers .

To declare a structure in C, you first use the 'struct' keyword followed by the structure name and the member declarations enclosed in braces. To initialize the structure, you can either use a block of values or assign values individually after declaration. For example: ```c struct Student { char name[50]; int age; float gpa; }; struct Student student1 = {"Alice", 20, 3.5}; ``` This declares a structure named 'Student' and initializes 'student1' with specified values .

Volatile memory, like RAM, is used for fast data access and temporary storage during active processes. It loses its data when power is turned off, making it unsuitable for long-term storage but ideal for tasks that require quick access to data. Non-volatile memory, in contrast, retains stored data even without power, examples being ROM and hard disk drives. Non-volatile memory is essential for storing data and system files persistently, whereas volatile memory optimizes speed and efficiency for active data processing .

Input devices in a computer system are used to provide data and control signals to the computer. Examples include keyboards for typing, mice for navigation, and microphones for audio input. Output devices, on the other hand, are used to convey the processed data from the computer to the user or another device. Examples include monitors for display, printers for printing documents, and speakers for sound output. These devices play a fundamental role in the interaction between the user and the computer system .

You might also like