Thursday, October 30, 2025

C Language One Mark Question / Answer

Prepared By : Prof. Uday Shah (HOD - IT)


C Language One Mark Question / Answer 


  Fill in the Blanks (with Answers)

  • C language was developed by Dennis Ritchie.
  • C language was developed at Bell Labs.
  • C language was developed in the year 1972.
  • C is a structured programming language.
  • The collection of symbols used in C is called C Character Set.
  • Keywords are reserved words in C with predefined meanings.
  • The smallest individual unit in a program is called a token.
  • A sequence of characters enclosed in double quotes is called a string.
  • Identifiers are names given to variables, functions, or arrays.
  • Constants are fixed values that cannot be changed.
  • The symbol == is a comparison operator.
  • The precedence of *, /, % is higher than +, -.
  • Automatic conversion of one data type to another is called type conversion.
  • Conversion done by the user is called type casting.
  • #include is a preprocessor directive.
  • // is used for single-line comments.
  • A flowchart uses symbols to represent an algorithm.
  • A step-by-step problem-solving method is an algorithm.
  • A dry run is used to test a program manually without execution.
  • The file extension for C source files is .c.

True / False (with Answers)

  • C is a high-level language. — True
  • Keywords in C can be redefined. — False
  • main() function is compulsory. — True
  • Identifiers can start with a digit. — False
  • C supports both type conversion and type casting. — True
  • All operators have the same precedence. — False
  • Flowcharts are written using programming code. — False
  • Constants can be changed during execution. — False
  • /* … */ is used for multi-line comments. — True
  • #define defines symbolic constants. — True
  • Variable names are case-sensitive. — True
  • An algorithm is a graphical representation. — False
  • Strings end with \0 in C. — True
  • char stores more than one character. — False
  • C language is platform dependent. — True

Full Forms & Short Answers (with Answers)

  • ASCII stands for American Standard Code for Information Interchange.
  • IDE stands for Integrated Development Environment.
  • printf stands for print formatted.
  • scanf stands for scan formatted.
  • && operator is Logical AND.
  • || operator is Logical OR.
  • ! operator is Logical NOT.
  • %d prints an integer.
  • %f prints a float.
  • %c prints a character.
  • %s prints a string.
  • One logic development technique – Flowchart / Algorithm.
  • Building blocks of a C program – tokens.
  • Dry run means manually checking the logic without executing.
  • First step in program development – Problem Analysis / Algorithm Design.
:: Thank You :: 

Glossary of C Language for IT Studetns

Prepared By : Prof. Uday Shah (HOD -IT)


Glossary of C Language 

  • Compiler – Converts entire program into machine code.
  • Interpreter – Executes program line by line.
  • Algorithm – Step-by-step solution procedure.
  • Flowchart – Diagrammatic representation of logic.
  • Source Code – Human-readable program written in C.
  • Object Code – Machine code produced by compiler.
  • IDE – Environment for writing, compiling, debugging.
  • Tokens – Smallest elements (keywords, operators, identifiers).
  • Identifier – Programmer-defined name.
  • Keywords – Reserved words with predefined meaning.
  • Constants – Fixed values used in program.
  • Variables – Storage for data values.
  • Data Types – Define type of variable (int, float, char).
  • Operators – Symbols to perform operations (+, -, *, /).
  • Operands – Values on which operators act.
  • Type Casting – Conversion from one data type to another.
  • Expression – Combination of operators and operands.
  • Sequence – Normal execution order of statements.
  • Selection – Decision-making (if, if-else, switch).
  • Iteration – Repeated execution (loops).
  • For Loop – Entry-controlled loop.
  • While Loop – Repeats while condition is true.
  • Do-While Loop – Exit-controlled loop.
  • Nested Loop – Loop inside another loop.
  • Break – Exits loop or switch.
  • Continue – Skips current iteration.
  • Goto – Jumps to a labeled statement.
  • Function – Block of reusable code.
  • Library Function – Built-in function (printf, scanf, strlen).
  • User-defined Function – Function created by programmer.
  • Function Declaration – Prototype defining return type and parameters.
  • Function Definition – Actual body of the function.
  • Function Call – Process of executing a function.
  • Return Type – Data type of value returned by function.
  • Arguments/Parameters – Values passed to a function.
  • Call by Value – Copy of value is passed to function.
  • Call by Reference – Address of variable is passed to function.
  • Recursion – Function calling itself.
  • Scope – Region where variable is accessible.
  • Local Variable – Declared inside a function, accessible only there.
  • Global Variable – Declared outside all functions, accessible anywhere.
  • Static Variable – Retains its value across function calls.
  • Array – Collection of similar elements in continuous memory.
  • 1D Array – Linear list of elements.
  • 2D Array – Matrix-like structure (rows & columns).
  • Multi-dimensional Array – More than 2 dimensions.
  • String – Array of characters ending with null ‘\0’.
  • String Literal – Text enclosed in double quotes.
  • strlen() – Returns string length.
  • strcpy() – Copies one string to another.
  • strcmp() – Compares two strings.
  • strcat() – Concatenates two strings.
  • Pointer – Variable storing address of another variable.
  • NULL Pointer – Pointer with no assigned address.
  • Dangling Pointer – Pointer referencing freed memory.
  • Pointer Arithmetic – Operations on pointer values.
  • Structure – Group of different data types under one name.
  • Union – Special structure sharing same memory for all members.
  • typedef – Keyword to create alias for data type.
  • File Handling – Reading and writing data in files.
  • fopen() – Opens a file.
  • fclose() – Closes a file.
  • fprintf()/fscanf() – File input/output (formatted).
  • fread()/fwrite() – File input/output (binary).

:: Best of Luck ::

MCA 1 : Android Using Kotlin Unit 2 : Kotlin Programming Language , class and Inheritance

Prepared By : Prof. Uday Shah (HOD -IT) 


Unit 2 : Kotlin Programming Language , class and Inheritance 

1. Introduction to Kotlin. 1

2. Basic Syntax and Data Types. 2

3. Variables. 2

4. Conditions. 3

5. Control Flow and Loops. 3

6. List and Array. 4

7. Function and Classes in Kotlin. 5

8. Constructor. 5

9. Inheritance. 6

10. Interface. 6

11. Enum.. 7

 

 1. Introduction to Kotlin

  • Kotlin is a modern, statically-typed programming language developed by JetBrains.
  • It is fully interoperable with Java, meaning Kotlin code can use Java libraries and vice versa.
  • Officially supported by Google for Android app development since 2017.
  • Kotlin code is concise, expressive, and safe from common programming errors.
  • It runs on the Java Virtual Machine (JVM) and can also compile to JavaScript or native code.
  • Offers features like null safety, extension functions, and coroutines.
  • Reduces boilerplate code compared to Java.
  • Strongly supports object-oriented and functional programming paradigms.
  • Uses smart casts and type inference to simplify coding.
  • Kotlin files typically have the .kt extension.
  • Provides enhanced readability and maintainability.
  • Supported by Android Studio with full tooling support.
  • Used not only for Android but also for backend (Ktor), web, and multiplatform projects.

 2. Basic Syntax and Data Types

  • Kotlin syntax is simple and expressive, similar to modern languages like Swift or Python.
  • Every Kotlin program starts with a main() function.
  • Statements do not require semicolons (;) — optional.
  • Uses val for read-only variables and var for mutable ones.
  • Data types include Int, Double, Float, Boolean, Char, String.
  • Kotlin has type inference, so you can omit explicit types in most cases.
  • Example: val age = 20 automatically detects Int.
  • Strings can be concatenated or formatted using ${variable} syntax.
  • Supports multi-line strings using triple quotes ("""...""").
  • Conversion between types uses .toInt(), .toDouble(), etc.
  • Variables are non-null by default; nullable ones must be declared with ?.
  • Example: var name: String? = null allows null assignment.
  • Consistent syntax makes code easier to read and debug.

 3. Variables

  • Variables are storage containers for data in Kotlin.
  • Declared using val (immutable) or var (mutable).
  • Example: val x = 10 (cannot change), var y = 20 (can change).
  • Kotlin automatically infers data type when assigned a value.
  • Variables can store primitive or object data types.
  • Support lateinit for delaying initialization in classes.
  • Constant values can be defined using const val at the top level.
  • Kotlin promotes immutability — using val for safer code.
  • Nullable variables allow storing null values safely using ?.
  • Supports string interpolation — "Hello, $name".
  • Global variables can be declared outside functions.
  • Variables can be initialized conditionally using if or when.
  • Improves memory efficiency and program safety.

 4. Conditions

  • Used to make decisions and control program flow.
  • if and else are the primary conditional statements.
  • Example:
  • if (age >= 18) println("Adult") else println("Minor")
  • if can also return a value, unlike in Java.
  • when is Kotlin’s replacement for the switch statement in Java.

Example:

when(day) {

    1 -> println("Monday")

    2 -> println("Tuesday")

    else -> println("Other Day")

}

  • Supports multiple conditions in one branch (in, !in, is, !is).
  • Makes code more readable and structured.
  • Nested conditions are supported for complex logic.
  • Conditions can handle both expressions and statements.
  • Logical operators like &&, ||, ! are used for combining conditions.
  • Simplifies decision-making and improves control over logic flow.

 5. Control Flow and Loops

  • Control flow allows repetitive tasks or branching execution.
  • Common loops: for, while, do-while.
  • for loop can iterate over ranges, arrays, or collections.
  • for (i in 1..5) println(i)
  • while loop runs while a condition is true.
  • do-while ensures the loop runs at least once.
  • Supports loop control statements: break, continue, and return.
  • Can iterate backward using downTo and skip steps using step.
  • for (i in 10 downTo 1 step 2)
  • Supports labeled loops for nested iterations.
  • Allows combining with conditions for dynamic execution.
  • Loops and control flow help manage logic and repetitive operations efficiently.

 6. List and Array

  • Array: Fixed-size collection of same-type elements.
  • val numbers = arrayOf(1, 2, 3, 4)
  • Access elements using index: numbers[0].
  • Kotlin provides built-in functions like size, contains(), first(), etc.
  • List: Ordered collection, can be mutable or immutable.
  • val list = listOf("A", "B", "C") // immutable 
  • val mList = mutableListOf("A", "B", "C") // mutable
  • Supports iteration using loops or forEach().
  • Arrays are fixed in size; lists can dynamically grow.
  • Supports functional operations like map, filter, sorted, etc.
  • Can mix different data types using Any.
  • Provides null safety with optional types.
  • Lists and arrays are essential for data storage and manipulation.

 7. Function and Classes in Kotlin

  • Functions are reusable blocks of code that perform specific tasks.
  • Declared using fun keyword:
  • fun add(a: Int, b: Int): Int = a + b
  • Supports default and named arguments.
  • Can return values or perform actions (Unit type).
  • Classes are blueprints for creating objects.
  • Declared using the class keyword.

Example:

class Student(val name: String, val age: Int)

  • Supports encapsulation, inheritance, and polymorphism.
  • Members include properties, methods, and constructors.
  • Classes and functions together support modular programming.

 8. Constructor

  • Used to initialize class objects.
  • Two types: Primary and Secondary constructors.
  • Primary constructor is defined with class header:
  • class Person(val name: String, var age: Int)
  • Secondary constructor provides alternate ways to create objects.
  • constructor(name: String): this(name, 0)
  • init block runs automatically after the primary constructor.
  • Constructors help assign initial values to properties.
  • Provide flexibility in object creation.
  • Default values can simplify initialization.
  • Support inheritance through super() calls.
  • Ensure object setup before use.

 9. Inheritance

  • Allows one class to acquire properties and methods of another.
  • Base class (parent) and Derived class (child).
  • Declared using the open keyword since classes are final by default.

open class Animal {

    fun eat() { println("Eating...") }

}

class Dog: Animal() {

    fun bark() { println("Barking...") }

}

  • Supports method overriding with override keyword.
  • Promotes reusability and reduces redundancy.
  • Enables polymorphism — same interface, different behavior.
  • Child class can access parent’s public and protected members.
  • Constructors can be inherited and customized.
  • Follows the IS-A relationship.
  • Core part of OOP in Kotlin.

 10. Interface

  • Defines a contract of methods that implementing classes must follow.
  • Declared using the interface keyword.
  • interface Vehicle {
  •     fun start()
  • }
  • A class implements it using the : symbol.
  • Interfaces can contain abstract methods and default implementations.
  • A class can implement multiple interfaces (supports multiple inheritance).
  • Provides flexibility in design and reduces code dependency.
  • No state or constructors allowed in interfaces.
  • Used to achieve abstraction and polymorphism.

Example:

class Car: Vehicle {

    override fun start() { println("Car started") }

}

  • Helps in designing loosely coupled systems.

 11. Enum

  • Enum (Enumeration) defines a fixed set of constant values.
  • Declared using the enum class keyword.
  • enum class Direction { NORTH, SOUTH, EAST, WEST }
  • Each constant acts as an object of the enum type.
  • Enums can contain properties, methods, and constructors.
  • Useful for representing predefined choices (e.g., days, colors, directions).
  • Supports when expressions for decision-making.

Example:

when(direction) {

    Direction.NORTH -> println("Up")

    else -> println("Other")

}

  • Provides type safety — avoids invalid values.
  • Improves code clarity and maintainability.
  • Commonly used for flags, states, and modes in Android apps.

 

:: Thank You ::


MCA 1 Android Using Kotlin - Unit 1 ( Introduction to Android IDE and Android Studio)

Prepared By : Prof. Uday Shah (HOD-IT)


Unit 1 ( Introduction to Android IDE and Android Studio)

1. Introduction. 1

2. Advantages. 2

3. Difference between Mobile, Web, and Hybrid Applications. 2

4. Introduction to Android Operating System.. 3

5. Android Versions with Features. 3

6. Android Architecture. 3

7. OHA (Open Handset Alliance) 4

8. Introduction of Android Studio. 4

9. Android SDK. 5

10. Android Development Tools. 5

11. Android Virtual Devices (AVD) 6

12. Directory Structure of Android Application. 6

13. Activity & Application Life Cycle. 6

14. Anatomy of Android Application. 7

15. Android Manifest File. 7

16. R.java File. 8

 

 

 1. Introduction

  • Android is an open-source operating system developed by Google for mobile devices such as smartphones and tablets.
  • It is based on the Linux kernel and primarily designed for touch-based devices.
  • Android provides a rich user interface, background services, and multitasking capabilities.
  • The Android platform includes tools, libraries, and APIs for developing apps.
  • Apps are mainly developed using Java or Kotlin languages.
  • It uses the Dalvik Virtual Machine (DVM) or Android Runtime (ART) for executing code.
  • Android applications are packaged as .apk (Android Package) files.
  • It allows developers to access device hardware like camera, GPS, sensors, etc.
  • Android supports third-party app installations via Google Play Store or manually.
  • Its open-source nature allows customization by device manufacturers and developers.

 2. Advantages

  • Open-source platform – freely available for modification and customization.
  • Supports a wide range of devices and hardware configurations.
  • Easy integration with Google services like Maps, Drive, Gmail, etc.
  • Large developer community with extensive documentation and libraries.
  • Provides flexibility through Android SDK for creating innovative apps.
  • Offers high performance through ART and optimized memory usage.
  • Supports background services and multitasking.
  • Regular updates enhance security and functionality.
  • Compatible with multiple screen sizes and resolutions.
  • Simple to deploy and distribute apps through Google Play Store.

 3. Difference between Mobile, Web, and Hybrid Applications

  • Mobile Apps: Installed directly on the device; developed using Java/Kotlin (Android) or Swift (iOS).
  • Web Apps: Run in web browsers using HTML, CSS, JavaScript — no installation needed.
  • Hybrid Apps: Combine both — built using web technologies but wrapped in a native shell.
  • Mobile apps can work offline, whereas web apps need internet access.
  • Web apps are platform-independent; mobile apps are OS-specific.
  • Hybrid apps use frameworks like Ionic, React Native, or Flutter.
  • Mobile apps have better performance and access to device features.
  • Web apps are easier to maintain and update.
  • Hybrid apps balance cost and performance.
  • Choice depends on project goals and target audience.

 4. Introduction to Android Operating System

  • Android OS manages hardware and software resources of the device.
  • It includes kernel, libraries, runtime, and application framework.
  • It enables user interaction through touchscreen, voice, and gestures.
  • Offers security through sandboxing and app permissions.
  • Android uses activities, services, broadcast receivers, and content providers.
  • The OS handles memory management and process control.
  • Supports background tasks and notifications.
  • Provides a consistent UI design using Material Design guidelines.
  • Allows OTA (Over The Air) updates for devices.
  • Enables connectivity through Bluetooth, Wi-Fi, and cellular networks.

 5. Android Versions with Features

  • Android started from version 1.0 to the latest Android 14 (Upside Down Cake).
  • Earlier versions were named alphabetically after desserts (Cupcake, Donut, Pie, etc.).
  • Each version introduced UI and performance improvements.
  • Android 5 (Lollipop): Introduced Material Design.
  • Android 6 (Marshmallow): Added app permissions and Doze mode.
  • Android 7–9: Enhanced notifications and multitasking.
  • Android 10–12: Improved privacy, gesture navigation, and dark mode.
  • Android 13–14: Added per-app language, better security, and energy optimization.
  • Regular updates enhance performance and compatibility.
  • Google Play services ensure backward compatibility.

 6. Android Architecture

  • Divided into four main layers:
    1. Linux Kernel – Handles hardware drivers, memory, process management.
    2. Libraries – Provides core functions (SQLite, WebKit, OpenGL, etc.).
    3. Android Runtime (ART) – Executes app code efficiently.
    4. Application Framework – Provides APIs for UI, data, and app control.
  • Applications sit at the top of the architecture.
  • Each layer interacts with the one below it.
  • Ensures modularity, reusability, and stability.
  • Architecture supports secure and scalable app development.

 7. OHA (Open Handset Alliance)

  • A consortium of Google and 80+ companies like Samsung, LG, HTC, etc.
  • Formed in 2007 to develop open standards for mobile devices.
  • Its main goal is to promote Android as an open and unified mobile platform.
  • Encourages manufacturers to use Android freely.
  • Reduces fragmentation across devices.
  • Provides shared research and technology.
  • Supports rapid innovation in mobile computing.
  • Helps maintain compatibility between hardware and software.
  • Encourages collaboration between developers, carriers, and manufacturers.
  • Resulted in the global success of Android OS.

 8. Introduction of Android Studio

  • Official IDE (Integrated Development Environment) for Android app development.
  • Developed by Google, based on IntelliJ IDEA.
  • Provides tools for writing, debugging, testing, and packaging apps.
  • Supports Gradle build system for managing dependencies.
  • Offers code completion, refactoring, and linting tools.
  • Integrated emulator for testing apps on virtual devices.
  • Real-time preview of layouts via XML editor.
  • Supports multiple languages (Java, Kotlin, C++).
  • Includes version control integration (Git, SVN).
  • Cross-platform — works on Windows, macOS, and Linux.

 9. Android SDK

  • SDK (Software Development Kit) provides tools and APIs to build Android apps.
  • Includes compiler, debugger, libraries, and sample projects.
  • Contains ADB (Android Debug Bridge) for device communication.
  • Includes Android Emulator for virtual testing.
  • Offers platform tools and system images for various Android versions.
  • Updated regularly with new APIs and security patches.
  • Works with Android Studio seamlessly.
  • Supports backward compatibility with older Android devices.
  • Essential for compiling and running apps.
  • Developers must configure SDK paths in Android Studio.

 10. Android Development Tools

  • A collection of utilities to build and manage Android projects.
  • Includes ADB, SDK Manager, AVD Manager, Lint, and Logcat.
  • ADB enables debugging and transferring data between PC and device.
  • Lint checks code for potential errors and optimizations.
  • Logcat shows runtime logs for debugging.
  • SDK Manager manages SDK versions and updates.
  • Gradle automates building and packaging processes.
  • These tools improve productivity and code quality.
  • Help monitor app performance and memory usage.
  • Provide real-time debugging support.

 11. Android Virtual Devices (AVD)

  • AVD is an emulator that mimics a real Android device on your computer.
  • Allows testing apps without physical devices.
  • Supports various screen sizes, resolutions, and Android versions.
  • Can simulate phone calls, GPS, battery levels, and sensors.
  • Created and managed through AVD Manager in Android Studio.
  • Helps detect UI and performance issues early.
  • Developers can test multiple device configurations.
  • Saves cost and time during app development.
  • Supports fast boot for quicker startup.
  • Essential for testing compatibility across devices.

 12. Directory Structure of Android Application

  • Every Android project follows a predefined folder structure.
  • manifests/ – Contains AndroidManifest.xml describing app components.
  • java/ – Stores source code files (.java or .kt).
  • res/ – Holds resources like layouts, strings, images, colors, etc.
  • drawable/ – For images and icons.
  • layout/ – XML files for UI design.
  • values/ – Contains strings.xml, colors.xml, styles.xml.
  • Gradle Scripts/ – Build configuration files.
  • Maintains organized and modular app structure.
  • Helps Android Studio build and compile efficiently.

 13. Activity & Application Life Cycle

  • Activity: Represents a single screen in an app (like MainActivity).
  • Life Cycle Methods: onCreate(), onStart(), onResume(), onPause(), onStop(), onDestroy().
  • System calls these methods automatically during state changes.
  • Application Life Cycle: Handles overall app process and memory management.
  • Proper handling prevents app crashes and data loss.
  • Developers can save or restore state using onSaveInstanceState().
  • Understanding lifecycle ensures better resource management.
  • Crucial for background tasks and navigation handling.
  • Helps maintain smooth user experience.
  • Managed by Android OS dynamically.

 14. Anatomy of Android Application

  • Every Android app consists of components: Activities, Services, Broadcast Receivers, Content Providers.
  • Activities manage UI; Services handle background operations.
  • Broadcast Receivers respond to system-wide events.
  • Content Providers manage shared data (contacts, media, etc.).
  • The Manifest file defines these components.
  • Uses resources from res directory for layouts and strings.
  • Each app runs in its own process and sandbox.
  • Uses Intents to communicate between components.
  • APK is the final packaged file for distribution.
  • Ensures modular, secure, and flexible architecture.

 15. Android Manifest File

  • Core configuration file located at app/src/main/AndroidManifest.xml.
  • Declares app components (activities, services, receivers).
  • Specifies permissions (internet, camera, storage, etc.).
  • Defines app’s package name and version.
  • Declares intent filters and app icons.
  • Helps Android OS identify entry points (like MainActivity).
  • Controls app behavior and access control.
  • Includes metadata for Google Play.
  • Must be valid XML format.
  • Any change in structure requires recompilation of the app.

 16. R.java File

  • Automatically generated file by Android build tools.
  • Acts as a bridge between Java/Kotlin code and XML resources.
  • Contains unique IDs for all resources (layout, drawable, string, etc.).
  • Located in gen/ folder of the project.
  • Developers use it to access resources via syntax like R.layout.activity_main.
  • It’s updated automatically when you add or modify resources.
  • Should not be edited manually.
  • Helps link UI elements with backend logic.
  • Ensures compile-time resource binding.
  • Critical for resource management in Android apps.

 

:: Thank You ::