0% found this document useful (0 votes)
2 views

FCP 1 DataComm+ProgC

Uploaded by

kalpitnagar106
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views

FCP 1 DataComm+ProgC

Uploaded by

kalpitnagar106
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 36

FUNDAMENTALS OF

COMPUTER AND
PROGRAMMING
Dr. Raghavendra Pal
Syllabus
Syllabus
Syllabus
Syllabus
Data Communication
◦The term telecommunication means communication at a distance.
The word data refers to information presented in whatever form is
agreed upon by the parties creating and using the data. Data
communications are the exchange of data between two devices via
some form of transmission medium such as a wire cable.
Transmission media
GUIDED MEDIA: Twisted Pair Cable
◦ Twisted pair cable is a type of wiring in which two
conductors of a single circuit are twisted together for the
purposes of improving electromagnetic compatibility.
The wires are twisted to cancel out electromagnetic
interference (EMI) from external sources and crosstalk
from adjacent pairs.
◦ Data is transmitted over the twisted pairs as electrical
signals.
Coaxial cable
◦ Coaxial cable, or coax, is a type of electrical cable consisting of a central conductor, an insulating layer, a
metallic shield, and an outer insulating layer.
◦ It is used for transmitting cable television signals, internet connections, and other data communications.
Optical Fiber
◦ Optical fiber is a flexible, transparent fiber made of high-quality glass (silica) or plastic, slightly thicker than a
human hair, that functions as a waveguide or light pipe to transmit light between the two ends of the fiber. It is
primarily used in telecommunications and networking, where it enables long-distance, high-speed data
transmission. Optical fibers operate on the principle of total internal reflection, allowing light to be guided through
the core of the fiber with minimal loss. This makes them highly effective for transmitting large amounts of data
over long distances with high fidelity and low attenuation.
UNGUIDED MEDIA: WIRELESS

◦ Unguided media transport electromagnetic waves without using a physical


conductor. This type of communication is often referred to as wireless
communication.
What is Multiplexing? Think of it as Sharing a
Highway!
•A highway has multiple roads, each used by different cars (data stream).
These lanes merge into a single, wider road (multiplexed data stream) on
the highway.
• Imagine multiple cars (conversations, videos, messages) driving on separate
roads (individual data streams). Multiplexing is like combining these roads into
one highway to travel together.
• Multiplexing allows multiple data streams to share the same communication
channel, saving space and increasing efficiency.
◦Multiplexing helps many different signals travel together over one path,
like cars sharing a highway.
What is Switching? It’s Like Choosing the
Right Road at an Intersection!"
•A road intersection with multiple roads leading to different destinations.
The car (data packet) choosing the correct road (switching) to reach the
destination.
• Imagine you’re driving, and you reach an intersection with many roads.
Switching is like choosing the right road to get to your destination quickly.
• Switching directs each data packet to the correct path in a network, ensuring it
reaches its destination efficiently.
◦Switching is the process that guides each data packet along the best
route, just like choosing the right road at an intersection.
Five components of Data Communication
Data Flow types
NETWORKS
◦ A network is a set of devices (often referred to as nodes) connected by
communication links. A node can be a computer, printer, or any other device
capable of sending and/or receiving data generated by other nodes on the
network.
Types of connections: point-to-point and multipoint
Categories of topology
A fully connected mesh topology (five devices)
A star topology connecting four stations
A bus topology connecting three stations
A ring topology connecting six stations
A hybrid topology: a star backbone with three bus
networks
An isolated LAN connecting 12 computers to a hub in a
closet
WANs: a switched WAN and a point-to-point WAN
Characteristics of C Language
1. Simple and Efficient: C is straightforward and designed for efficient code execution. It offers
powerful low-level operations, enabling control over system hardware.
2. Portable: C code can run on different machines with minimal or no modification, making it
highly portable across platforms.
3. Structured Programming Language: C supports structured programming, meaning you can
break down large programs into smaller, manageable functions.
4. Rich Library Support: C comes with a standard library that offers various functions for tasks
like input/output, memory allocation, and more.
5. Memory Management: C allows direct manipulation of memory through pointers, offering
more control over resource management.
6. Fast and Efficient: The C language is compiled, not interpreted, resulting in faster execution
times.
7. Extensive Use: C is widely used in system software, embedded systems, and application
software.
Identifiers in C Language
Identifiers are names given to various program elements such as variables, functions,
arrays, etc.
Rules:
1. Must start with a letter (a-z, A-Z) or an underscore (_).
2. Can contain letters, digits (0-9), and underscores (_).
3. Cannot include special characters (e.g., @, #, $).
4. C is case-sensitive, so myVar and myvar are different identifiers.
Examples: age, total_sum, MyFunction, _temp.
Keywords in C Language

Keywords are reserved words in C that have a special meaning and cannot be used as
identifiers.
Examples: int, return, while, for, if, else, float, char.
Characteristics:
All keywords are written in lowercase.
Keywords have predefined meanings in C and are part of the C language syntax.
Examples in Context:
int main() - Here, int is a keyword that specifies the return type of the function main.
return 0; - return is a keyword used to exit a function and optionally return a value.
Data Types in C
Basic Data Types:
int: Used for integers (whole numbers).
•Example: int age = 25;
float: Used for single-precision floating-point numbers (decimals).
•Example: float temperature = 36.6;
double: Used for double-precision floating-point numbers (decimals).
•Example: double pi = 3.14159;
char: Used for characters.
•Example: char grade = 'A';
Data Types in C
Derived Data Types
Array: Collection of elements of the same type.
•Example: int numbers[5] = {1, 2, 3, 4, 5};
Pointer: Stores the address of a variable.
•Example: int *ptr; ptr = &age;
Structure: Groups different data types into a single unit.
•Example: struct Student { int id; char name[50]; };
Union: Similar to a structure, but members share the same memory location.
•Example: union Data { int i; float f; char str[20]; };
Data Types in C
Enumeration (enum): A user-defined data type that assigns names to integral constants.
•Example: enum week {Sunday, Monday, Tuesday};
Constants in C
Constants are fixed values that cannot be altered by the program during execution.
•Types of Constants:
•Integer Constants: Whole numbers without any fractional part.
•Example: const int MAX_VALUE = 100;
•Floating-point Constants: Numbers with fractional parts.
•Example: const float PI = 3.14;
•Character Constants: Single characters enclosed in single quotes.
•Example: const char NEWLINE = '\n';
•String Constants: Sequence of characters enclosed in double quotes.
•Example: const char GREETING[] = "Hello";
•Example in Context:
•Usage: #define PI 3.14159
Variables in C
Definition: Variables are named memory locations used to store data that can be modified
during program execution.
Declaration and Initialization:
Example: int age = 21;
Naming Rules:
Must start with a letter or underscore.
Can contain letters, numbers, and underscores.
Cannot use C keywords as variable names.
Types:
Local Variables: Declared inside a function and can only be used within that function.
Global Variables: Declared outside of all functions and can be accessed by any function
within the program.
Static Variables: Retain their value between function calls.
Declarations in C
Definition: A declaration informs the compiler about the name and type of a variable,
function, or any other identifier
before it is used in the code.
Purpose: It tells the compiler how much memory to allocate and what type of data the
variable will hold.
1. Variable Declaration
Syntax: data_type variable_name;
Example:
Integer Declaration: int age;
Character Declaration: char grade;
Multiple Declarations: You can declare multiple variables of the same type in one line.
Example: int x, y, z;
Declarations in C
2. Function Declaration
Syntax: return_type function_name(parameter_list);
Example:
int add(int a, int b);
Declares a function add that takes two integers as parameters and returns an integer.
3. Array Declaration
Syntax: data_type array_name[array_size];
Example:
int numbers[10];
Declares an array of 10 integers.
Statements in C
2. Function Declaration
Syntax: return_type function_name(parameter_list);
Example:
int add(int a, int b);
Declares a function add that takes two integers as parameters and returns an integer.
3. Array Declaration
Syntax: data_type array_name[array_size];
Example:
int numbers[10];
Declares an array of 10 integers.

You might also like