0% found this document useful (0 votes)
4 views1 page

2year Test ch9

The document is an examination paper for 2nd-year computer students, consisting of multiple choice questions, short questions, and long questions related to the C programming language. It covers topics such as data types, variable naming rules, operators, and memory structure. The test is designed to assess students' understanding of fundamental concepts in C programming.

Uploaded by

kamiowork1
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)
4 views1 page

2year Test ch9

The document is an examination paper for 2nd-year computer students, consisting of multiple choice questions, short questions, and long questions related to the C programming language. It covers topics such as data types, variable naming rules, operators, and memory structure. The test is designed to assess students' understanding of fundamental concepts in C programming.

Uploaded by

kamiowork1
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
You are on page 1/ 1

Student name Father name Class: 2nd year

Test: Computer Marks: 25 Time: 40min

Section A: Multiple Choice Questions (MCQs) (6X1=6)

1. Which of the following is a valid character constant in C?


a) "A" b) 'A' c) A d) =
2. What is the range of values for an int data type in C?
a) -32768 to 32767 b) 0 to 65535 c) -2147483648 to 2147483647 d) 0 to 4294967295
3. Which operator is used to find the remainder of a division in C?
a) / b) % c) * d) +
4. What is the maximum length of a variable name in C for most compilers?
a) 10 characters b) 31 characters c) 50 characters d) No limit
5. Which of the following is a valid variable name in C?
a) 2kgms b) total_marks c) #home d) double
6. What is the result of the expression 5 / 2 in C?
a) 2.5 b) 2 c) 3 d) 2.0

Section B: Short Questions (7X2=14)

1. What is an identifier in C? Name the two types of identifiers.


2. What is the difference between declaring and defining a variable in C?
3. Write the rules for naming variables in C.
4. What is the difference between a constant and a variable?
5. What is the purpose of the #define directive in C?
6. Explain the difference between int, float, and char data types.
7. What is the difference between ++i and i++ in C?
8. What is the purpose of the % operator in C? Provide an example.
9. What is the difference between && and || operators in C?
10. What is the purpose of comments in C? How are single-line and multi-line comments
written?

Section C: Long Questions (5X1=5)

I. Explain Variables with memory structure? Also explain the declaring and initialization of
the variable with examples
II. What are operators in C? Explain the following types of operators with examples:
a) Arithmetic Operators b) Relational Operators c) Logical Operators

You might also like