C Programming Notes — BCA Semester 1

C Programming Notes

Complete exam-focused notes covering the fundamentals of C programming — definitions, concepts, syntax and important programs for BCA Semester 1.

C
#include <stdio.h>

int main()
{
    printf("Hello, World!\n");

    return 0;
}

01. What is C Programming?

C is a general-purpose, procedural programming language developed by Dennis Ritchie at Bell Laboratories in the early 1970s.

Exam Definition

C is a general-purpose, procedural programming language used for developing system software, application software and embedded systems.

02. Features of C

C is popular because it provides both high-level programming features and low-level memory control.

  • Simple and efficient
  • Structured programming language
  • Portable
  • Fast execution
  • Rich set of operators
  • Supports pointers
  • Supports functions
  • Extensible

03. Basic Structure of a C Program

A C program generally consists of header files, the main function, declarations, statements and a return statement.

#include <stdio.h>

int main()
{
    int a = 10;

    printf("%d", a);

    return 0;
}
Exam Tip

Remember the basic flow: Header → main() → Declaration → Statements → return 0

04. Data Types

A data type specifies the type of data that a variable can store.

Data TypePurposeExample
intInteger values10
floatDecimal values10.5
charSingle character'A'
doubleLarge decimal values10.5678

05. Variables

Definition

A variable is a named memory location used to store a value that can change during program execution.

int age = 18;
float marks = 85.5;
char grade = 'A';

06. Operators

Operators are symbols used to perform operations on operands.

Arithmetic + − × ÷ %
Relational == != > < >= <=
Logical && || !
Assignment = += -= *= /=

07. Control Statements

Control statements determine the order in which statements are executed.

Decision Making

  • if
  • if-else
  • else-if
  • switch

Looping Statements

  • for loop
  • while loop
  • do-while loop

08. Functions

Definition

A function is a block of code designed to perform a specific task.

int add(int a, int b)
{
    return a + b;
}

09. Arrays

Definition

An array is a collection of elements of the same data type stored in contiguous memory locations.

int numbers[5] = {
    10, 20, 30, 40, 50
};

10. Pointers

Exam Definition

A pointer is a variable that stores the memory address of another variable.

int a = 10;

int *ptr = &a;

⚡ Last-Minute Revision

  • Learn the definition of C.
  • Remember the basic structure of a C program.
  • Revise all basic data types.
  • Learn operator categories.
  • Understand if, switch and loops.
  • Practice arrays and functions.
  • Remember the definition of pointers.
  • Practice basic C programs.

Recommended Posts