Sunday, August 31, 2025

Lesson 1 (Eng. medium Q& A)


Algol to Traditional C & Basics of C Programming

(Question Answers)

A. Multiple Choice Questions (20)

  1. Algol was mainly used for:
    (a) Web Development
    (b) Scientific Computations
    (c) Gaming
    (d) Mobile Apps
    Ans:- (b) Scientific Computations

  2. Which language influenced many modern programming languages?
    (a) Java
    (b) Algol
    (c) Python
    (d) HTML
    Ans:- (b) Algol

  3. Who developed BCPL?
    (a) Ken Thompson
    (b) Dennis Ritchie
    (c) Martin Richards
    (d) Brian Kernighan
    Ans:- (c) Martin Richards

  4. The B language was developed for which operating system?
    (a) Windows
    (b) Linux
    (c) UNIX
    (d) Android
    Ans:- (c) UNIX

  5. Who invented the C language?
    (a) Ken Thompson
    (b) Dennis Ritchie
    (c) Martin Richards
    (d) Bill Gates
    Ans:- (b) Dennis Ritchie

  6. In which year was C developed?
    (a) 1966
    (b) 1969
    (c) 1972
    (d) 1978
    Ans:- (c) 1972

  7. The famous book “The C Programming Language” was co-authored by:
    (a) Ritchie & Richards
    (b) Thompson & Ritchie
    (c) Kernighan & Ritchie
    (d) Kernighan & Richards
    Ans:- (c) Kernighan & Ritchie

  8. Traditional C is also called:
    (a) K&R C
    (b) ANSI C
    (c) Turbo C
    (d) Modern C
    Ans:- (a) K&R C

  9. Which is NOT an advantage of C?
    (a) Fast and Efficient
    (b) Object-Oriented
    (c) Close to Hardware
    (d) Portable
    Ans:- (b) Object-Oriented

  10. Which of the following is a disadvantage of C?
    (a) Fast execution
    (b) Secure data handling
    (c) Manual memory management
    (d) Structured programming
    Ans:- (c) Manual memory management

  11. POP stands for:
    (a) Program Oriented Programming
    (b) Process Oriented Programming
    (c) Procedure Oriented Programming
    (d) Processor Operating Program
    Ans:- (c) Procedure Oriented Programming

  12. Which language is an example of OOP?
    (a) C
    (b) Pascal
    (c) FORTRAN
    (d) Java
    Ans:- (d) Java

  13. In OOP, data and functions are kept:
    (a) Separate
    (b) Together in objects
    (c) Only in functions
    (d) Only in data
    Ans:- (b) Together in objects

  14. Which of the following is NOT a keyword in C?
    (a) int
    (b) return
    (c) name
    (d) while
    Ans:- (c) name

  15. Which of these identifiers is valid?
    (a) 1total
    (b) total_marks
    (c) int
    (d) return
    Ans:- (b) total_marks

  16. Range of char in C is:
    (a) 0 to 255
    (b) -128 to 127
    (c) -32768 to 32767
    (d) None
    Ans:- (b) -128 to 127

  17. Which operator is used for modulus (remainder)?
    (a) %
    (b) /
    (c) *
    (d) &
    Ans:- (a) %

  18. Which operator checks equality in C?
    (a) =
    (b) ==
    (c) !=
    (d) <=
    Ans:- (b) ==

  19. sizeof operator in C is used to find:
    (a) Variable value
    (b) Data type size
    (c) Program size
    (d) Number of variables
    Ans:- (b) Data type size

  20. Which is a Null Statement in C?
    (a) { }
    (b) ;
    (c) return 0;
    (d) #include<stdio.h>
    Ans:- (b) ;


B. Very Short Answer Questions (10)

  1. What does Algol stand for?
    Ans:- Algorithmic Language

  2. Who developed the B language?
    Ans:- Ken Thompson

  3. In which year was BCPL created?
    Ans:- 1966

  4. What is Traditional C also known as?
    Ans:- K&R C (Kernighan & Ritchie C)

  5. Name the co-authors of “The C Programming Language”.
    Ans:- Dennis Ritchie and Brian Kernighan

  6. Which feature of C makes it close to hardware?
    Ans:- Direct memory access / pointer support

  7. What does OOP stand for?
    Ans:- Object-Oriented Programming

  8. Give one example of POP language.
    Ans:- C language

  9. How many keywords are there in C?
    Ans:- 32 keywords

  10. What is an identifier in C?
    Ans:- A name given to variables, functions, or arrays in a program.


C. Short Answer Questions (10)

  1. State one importance of Algol.
    Ans:- Algol laid the foundation for structured programming and influenced many modern programming languages like C, Pascal, and Java.

  2. Explain the role of BCPL in C’s development.
    Ans:- BCPL was a simple and powerful system programming language created by Martin Richards. It directly influenced the design of B language, which later evolved into C.

  3. Why was B language considered limited?
    Ans:- B language lacked data types and other advanced features, making it less powerful and less efficient for large system programming.

  4. List two advantages of C language.
    Ans:- (i) It is fast and efficient. (ii) It is portable and can run on different systems easily.

  5. Write two disadvantages of C language.
    Ans:- (i) It is not object-oriented. (ii) It requires manual memory management, which may lead to errors.

  6. Differentiate between POP and OOP in terms of data security.
    Ans:- In POP, data is not secure because functions and data are separate. In OOP, data is secure as it is combined with functions inside objects (encapsulation).

  7. Write rules for naming identifiers in C.
    Ans:- Identifiers must start with a letter or underscore, can contain letters, digits, and underscores, cannot be a keyword, and are case-sensitive.

  8. What are the three main categories of C data types?
    Ans:- (i) Primary (Fundamental) data types, (ii) User-defined data types, (iii) Derived data types.

  9. Define an operator with one example.
    Ans:- An operator is a symbol used to perform operations on data. Example: + is an operator, 5+3=8.

  10. What does the conditional (ternary) operator do in C?
    Ans:- It provides a shorthand for if-else statements. Example: max = (a > b) ? a : b;.


D. Long Answer Questions (5)

  1. Describe the historical development of the C language from Algol to Traditional C.
    Ans:- Algol was developed in the 1950s for scientific computations and introduced structured programming. In 1966, Martin Richards created BCPL, which influenced system-level programming. In 1969, Ken Thompson developed the B language for UNIX, but it was limited. In 1972, Dennis Ritchie developed the C language at Bell Labs by improving B. In 1978, the first standard version of C was documented in the book “The C Programming Language” by Kernighan and Ritchie, which became known as Traditional C.

  2. Explain the difference between Procedure-Oriented Programming (POP) and Object-Oriented Programming (OOP) with features.
    Ans:- POP is based on dividing a program into functions and focuses on process/logic. Data is separate from functions, making it less secure. Examples: C, Pascal. OOP is based on objects, where data and functions are combined. It provides features like encapsulation, inheritance, and code reusability. Examples: C++, Java. POP is traditional, while OOP is modern and suitable for complex applications.

  3. Discuss the advantages and disadvantages of C language in detail.
    Ans:- Advantages: (i) C is fast and efficient. (ii) Portable and suitable for system programming. (iii) Structured programming makes coding easy. (iv) Good foundation for other languages. Disadvantages: (i) Not object-oriented. (ii) Manual memory management makes it less secure. (iii) No built-in GUI support. (iv) Error handling is difficult compared to modern languages.

  4. Write a note on data types in C with examples of primary, user-defined, and derived types.
    Ans:- C supports three categories of data types. Primary types include int, char, float, double, etc. Example: int age = 20;. User-defined types include struct, union, enum, and typedef, created by programmers. Example: struct student { int roll; char name[20]; };. Derived types are created from fundamental types, such as arrays, pointers, and functions. Example: int arr[5]; (array), int *p; (pointer). These types make C flexible for programming.

  5. Explain the different types of operators in C with suitable examples.
    **Ans:- C operators are:
    (i) Arithmetic operators (+, -, , /, %). Example: a+b.
    (ii) Relational operators (==, !=, >, <, >=, <=). Example: a>b.
    (iii) Logical operators (&&, ||, !). Example: a>5 && b<10.
    (iv) Assignment operators (=, +=, -=, =, /=). Example: a+=5.
    (v) Increment/Decrement operators (++ and --). Example: a++.
    (vi) Bitwise operators (&, |, ^, ~, <<, >>). Example: a & b.
    (vii) Conditional (?:). Example: (a>b)?a:b.
    (viii) sizeof operator. Example: sizeof(int).
    These operators make C powerful and versatile for calculations and logic building.

No comments:

Post a Comment

lesson 3 Array (Hindi medium Q&A)

  Array (ऐरे) – प्रश्नोत्तर  Part A: Multiple Choice Questions (1 अंक प्रत्येक) Q1. एक ऐरे (Array) किन प्रकार के मान (values) को संग्रहीत...