C Programming Fundamentals

SportyPegasus avatar
SportyPegasus
·
·
Download

Start Quiz

Study Flashcards

29 Questions

What is the primary purpose of a variable in C?

To hold a value

Which of the following is a derived data type in C?

array

What is the operator for modulus (remainder) in C?

%

What is the purpose of the double data type in C?

To store decimal numbers with higher precision

What is the function of the ++ operator in C?

Increment

What is the primary function of a semaphore in Operating Systems?

To synchronize access to shared resources

What is the purpose of IP sub-netting in Computer Networking?

To divide a network into smaller sub-networks

What is the function of a bridge in Computer Networking?

To connect two networks of different topologies

What is the purpose of the E-R model in Database Systems?

To define relationships between entities

What is the purpose of constructor in Object Oriented Programming?

To initialize an object

What is the purpose of Round Robin scheduling algorithm in Operating Systems?

To allocate CPU time to processes

What is the purpose of a repeater in Computer Networking?

To amplify weak signals

What is the purpose of normalization in Database Systems?

To reduce data redundancy

What is the primary function of a multiplexer in digital electronics?

To select one of several input signals and forward it to a single output

What is the definition of a matrix in linear algebra?

A matrix is a table of values with a specific number of rows and columns.

What is the purpose of a latch in digital electronics?

To store data temporarily

What is the purpose of the transpose of a matrix?

To swap the rows and columns of a matrix.

What is the focus of Flynn's classification in computer organization?

Classification of computer architectures

What is the name of the method used to solve a system of linear equations with 3 variables?

Cramer's rule.

What is the purpose of a queue data structure?

To implement a first-in, first-out (FIFO) data structure

What is the concept of resolving a given rational function into partial fractions?

Partial Fractions.

What is the property of a trigonometric function that describes the ratio of the opposite side to the hypotenuse?

Sine.

What is the purpose of a pipeline in computer organization?

To increase the speed of instruction execution

What is the concept of a complex number in mathematics?

A number that can be expressed as a + bi, where a and b are real numbers.

What is the purpose of a registers in computer organization?

To store data temporarily

What is the purpose of a binary tree data structure?

To store data in a hierarchical manner

What is the formula to find the distance of a point from a line in analytical geometry?

Distance = |(y2 - y1)x1 - (x2 - x1)y1 + x2y1 - x1y2| / sqrt((y2 - y1)^2 + (x2 - x1)^2).

What is the purpose of a counter in digital electronics?

To count the number of input pulses

What is the concept of finding the angle between two lines in analytical geometry?

Tan(A) = (m2 - m1) / (1 + m2*m1).

Study Notes

Variables and Data Types

  • In C, a variable is a named storage location that holds a value.
  • Variables have a specific data type, which determines the type of value they can hold.
  • Basic data types in C:
    • int: whole numbers, e.g. 1, 2, 3, etc.
    • float: decimal numbers, e.g. 3.14, -0.5, etc.
    • char: single characters, e.g. 'a', 'B', etc.
    • double: double precision decimal numbers, e.g. 3.14159, -0.50001, etc.
  • Derived data types in C:
    • array: a collection of values of the same type, e.g. int scores[5];
    • struct: a collection of values of different types, e.g. struct person { int age; char name[20]; };
    • pointer: a variable that holds the memory address of another variable, e.g. int *ptr;

Operators

  • Arithmetic operators:
    • + addition
    • - subtraction
    • * multiplication
    • / division
    • % modulus (remainder)
    • ++ increment
    • -- decrement
  • Comparison operators:
    • == equal to
    • != not equal to
    • > greater than
    • < less than
    • >= greater than or equal to
    • <= less than or equal to
  • Logical operators:
    • && logical AND
    • || logical OR
    • ! logical NOT
  • Assignment operators:
    • = assignment
    • += addition assignment
    • -= subtraction assignment
    • *= multiplication assignment
    • /= division assignment
    • %= modulus assignment

Control Flow

  • Conditional statements:
    • if statement: if (condition) { code to execute; }
    • if-else statement: if (condition) { code to execute; } else { code to execute; }
  • Loops:
    • while loop: while (condition) { code to execute; }
    • for loop: for (init; condition; increment) { code to execute; }
  • Jump statements:
    • break statement: exits the current loop or switch statement
    • continue statement: skips the current iteration of the loop
    • return statement: exits the current function and returns a value

Functions

  • A function is a block of code that can be called multiple times from different parts of the program.
  • Functions can take arguments, which are values passed to the function when it is called.
  • Functions can return values, which are passed back to the calling code.
  • Functions can be declared with a specific return type, e.g. int add(int, int);

Input/Output

  • stdio library provides functions for input/output operations:
    • scanf() function: reads input from the user
    • printf() function: prints output to the screen
  • Format specifiers:
    • %d for integers
    • %f for floats
    • %c for characters
    • %s for strings

Arrays and Strings

  • Arrays:
    • A collection of values of the same type, stored in contiguous memory locations.
    • Declared using the [] syntax, e.g. int scores[5];
    • Accessed using the index, e.g. scores[0] = 10;
  • Strings:
    • A sequence of characters, terminated by a null character (\0).
    • Declared using the [] syntax, e.g. char name[20];
    • Manipulated using string functions, e.g. strcpy(), strcat(), strlen()

Pointers

  • A pointer is a variable that holds the memory address of another variable.
  • Declared using the * syntax, e.g. int *ptr;
  • Accessed using the dereference operator (*), e.g. int x = 10; int *ptr = &x; printf("%d", *ptr);
  • Pointer arithmetic:
    • ptr++ increments the pointer to point to the next memory location
    • ptr-- decrements the pointer to point to the previous memory location
    • ptr + n points to the memory location n steps ahead of the current pointer
    • ptr - n points to the memory location n steps behind the current pointer

Computer Science and Engineering (100 Marks)

Unit-I: Digital Electronics

  • Number systems and conversions
  • Codes: Binary, Hexadecimal, etc.
  • Logic gates: AND, OR, NOT, NOR, NAND, and XOR
  • Boolean Expressions
  • De-Morgan's theorems
  • K-Map
  • Combinational Circuits
  • Adders, Encoders, and Decoders
  • Multiplexers and De-multiplexers
  • Latches and Flip-flops
  • Edge and Level triggering
  • Counters and Registers
  • Semiconductor memories

Unit-II: Microprocessors

  • 8086 Microprocessor architecture
  • Segmentation concepts
  • Instruction set of 8086
  • Instruction formats
  • Addressing modes of 8086
  • Interrupts
  • Assembly Language Programming
  • Peripheral devices and interfacing
  • Intel 8255, 8257, 8251A, and 8279

Unit-III: Computer Organization

  • Functional blocks of a Digital Computer
  • Stored program concept
  • Fixed point and Floating point number representations
  • Instruction formats
  • Addressing modes
  • Memory hierarchy
  • Virtual memory and Associative memory
  • Cache memory
  • I/O Organization
  • Modes of data transfer: Programmed I/O, DMA, and Interrupt initiated I/O
  • Pipeline and Vector processing
  • Flynn's classification

Unit-IV: C Programming and Data Structures

  • Algorithms
  • Flowcharts
  • C Tokens
  • Data types
  • Operators and expressions
  • Precedence and Associativity of operators
  • Type conversions
  • Control statements
  • Arrays
  • Memory allocations
  • Strings
  • Functions and parameter passing
  • Pointers
  • Structures and Unions
  • Storage classes
  • Preprocessor directive statements
  • Files
  • Data Structures: Abstract Data Types, Time and Space complexities
  • Stacks and Queues
  • Linked Lists
  • Binary trees
  • Tree traversal techniques
  • Sorting: Bubble, Selection, Insertion, Quick, and Merge sorts
  • Searching: Sequential and Binary search techniques

Unit-V: Computer Hardware & Networking

  • BIOS
  • Components of Motherboard
  • Processors
  • Hard Disk Drives
  • Input & Output devices
  • Networking
  • Classification of networks
  • OSI reference model and TCP/IP reference model
  • Network topologies: Bus, Ring, Star, Mesh, and Hybrid
  • LAN components: Coaxial, Twisted pair, Optical fiber cables, and Connectors
  • LAN devices: Repeaters, Hubs, Bridges, Switches, NIC, Routers, and Modems
  • TCP/IP addressing scheme
  • IP address classes
  • IP Sub-netting
  • Linux commands

Unit-VI: Operating Systems

  • Operating System concepts
  • Services
  • Types
  • System calls
  • Process Management
  • CPU scheduling algorithms: FCFS, SJF, Round Robin, Priority, and Multilevel scheduling
  • Threads
  • Semaphores
  • Inter Process Communication
  • Deadlocks
  • Memory Management
  • Overlays
  • Paging
  • Segmentation
  • Virtual memory
  • Page replacement algorithms: FIFO, LRU, and Optimal
  • Thrashing
  • Disk scheduling
  • Disk scheduling algorithms: FIFO, SSJF, SCAN, and C-SCAN
  • File management
  • File operations
  • Access methods
  • Directory structure

Unit-VII: RDBMS

  • Concepts of Database systems
  • Data abstraction
  • Data independence
  • Data models
  • E-R model
  • Structure of Relational database
  • DDL, DML, and DCL commands
  • Keys
  • Normal Forms: 1st, 2nd, 3rd, and BCNF
  • SQL
  • Data types
  • Operators
  • Joins
  • Views
  • Sequences
  • Synonyms and indexes
  • PL/SQL
  • Data types
  • Control structures
  • Cursor management
  • Triggers
  • Exceptions
  • Functions
  • Procedures
  • Recursion and packages

Unit-VIII: Object Oriented Programming Through C++

  • Concepts of OOPs
  • Classes and objects
  • Constructors and destructors
  • Function overloading and Operator overloading
  • Inheritance types
  • Virtual functions
  • Friend functions
  • Inline functions
  • This pointer
  • I/O manipulators
  • File and I/O functions
  • Templates

Mathematics (50 Marks)

Unit-I: Matrices

  • Matrices: Definition, Types, and Algebra
  • Transpose of a matrix
  • Symmetric and skew symmetric matrices
  • Minor and cofactor of an element
  • Determinant of a square matrix
  • Properties of determinants
  • Laplace's expansion
  • Singular and non-singular matrices
  • Adjoint and multiplicative inverse of a square matrix
  • System of linear equations in 3 variables
  • Solutions by Cramer's rule, Matrix inversion method, and Gauss-Jordan method
  • Partial Fractions
  • Resolving a given rational function into partial fractions

Unit-II: Trigonometry

  • Properties of Trigonometric functions
  • Ratios of Compound angles, multiple angles, and sub multiple angles
  • Transformations of Products into sum or difference and vice versa
  • Properties of triangles
  • Sine rule, cosine rule, tangent rule, and projection rule
  • Solution of a triangle when three sides, two sides and an included angle, or one side and two angles are given
  • Inverse Trigonometric functions and Hyperbolic functions

Unit-III: Analytical Geometry

  • Straight Lines: different forms, distance of a point from a line, angle between two lines, and intersection of two non-parallel lines
  • Distance between two parallel lines
  • Complex Numbers: Definition, Modulus, amplitude, and conjugate of complex number
  • Arithmetic operations on complex numbers
  • Modulus-Amplitude form (Polar form) and Euler form (exponential form)

Test your knowledge of C programming basics, including variables, data types, operators, control flow, functions, input/output, arrays, strings, and pointers.

Make Your Own Quizzes and Flashcards

Convert your notes into interactive study material.

Get started for free
Use Quizgecko on...
Browser
Browser