Introduction to C Programming Language
The C programming language is a powerful, high-level, general-purpose programming
language developed by Dennis Ritchie in 1972 at Bell Labs. It was designed to create
system software and operating systems, especially the UNIX operating system. Due to its
versatility, efficiency, and portability, C has become the foundation for many modern
programming languages like C++, Java, and Python.
C is known as a structured programming language, which means it encourages the
programmer to break a problem into smaller, manageable functions. It is also considered
a middle level language, as it combines features of both low-level (assembly) and high-
level (human readable) languages. C provides access to memory through pointers and
allows direct manipulation of hardware, making it ideal for system level programming.
Despite being over five decades old, C remains highly relevant. It is widely used in
embedded systems, system programming, operating systems, and game development.
Its simplicity and control over hardware make it a preferred language for beginners as
well as professional developers.
Merits of C (Advantages)
Portability: Programs written in C can be run on different machines
Speed: C programs execute quickly due to its closet hardware nature.
Easy to Learn: The syntax is simple and straightforward.
Modularity: Code can be broken down into reusable functions.
Rich Library: C provides a wide range of built-in functions.
Powerful & Efficient: It allows manipulation of bits, bytes, and addresses.
Extensibility: New features can be easily added.
Demerits of C (Disadvantages)
No Modern Features: Lacks things like exception handling.
Poor GUI Support : Not ideal for developing graphical user interfaces.
No Namespaces: Can lead to name conflicts in large projects.
Less Safe: Allows operations that can corrupt memory (e.g., pointer
misuse).
Limited Error Handling: No built-in support for exceptions.
Requires More Effort: Development time is longer compared to modern high-level
languages.
Features of C Language (6 Points)
1. Simple and Efficient: C has a small set of keywords and easy syntax.
2. Structured Language: Encourages modular programming.
3. Fast and Powerful: Close to hardware, fast execution.
4. Portable: Code can run on various hardware with minor changes.
5. Rich Library Support: Built-in functions for complex tasks.
6. Memory Management: Manual control of memory using functions like malloc()
and free().
Fundamentals of C Language
Character Set
C uses a defined set of characters for writing programs:
Letters: AZ, az
Digits: 09
Special Symbols: + / = % & ^ ! @ $ _ { } [ ] ; , . < > etc.
Whitespace Characters: Space, tab, newline
Tokens
Tokens are the smallest building blocks of a C program. They include:
Keywords: Reserved words (e.g., int, return, if, while)
Identifiers: User defined names for variables, functions, arrays, etc.
Constants: Fixed values like numbers or characters (e.g., 5, 'a', 3.14)
Strings: Sequence of characters inside double quotes (e.g., "Hello")
Operators: Symbols to perform operations (e.g., +, , , /, =)
Separators: Symbols like ;, {}, (), [] used to separate statements.
Data Types
Primary Data Types: int, float, char, double
Derived Data Types: Arrays, Pointers, Functions
User Defined Types: struct, union, Enum, typedef
Variables
A variable is a named location used to store data.
Example:
c
int age = 16.
Operators
Arithmetic Operators: + , /, %
Relational Operators: ==, !=, >, <, >=, <=
Logical Operators: &&, ||,!
Assignment Operators: =, +=, =, etc.
Control Structures
Used to control the flow of program execution:
Conditional Statements: if, if else, switch
Loops: for, while do while
Jump Statements: break, continue, goto, return
include <stdio.h>
int main() {
int a = 10, b = 20, sum;
sum = a + b;
printf("The sum is: %d\n", sum);
return 0;
}
include <stdio.h>
int main() {
int num1 = 29, num2 = 5, remainder;
remainder = num1 % num2;
printf("The remainder is: %d\n", remainder);
return 0;
}
include <stdio.h>
int main() {
float km = 3.5;
float meters = km 1000;
printf("%.2f km is %.2f meters\n", km, meters);
return 0;
}
include <stdio.h>
int main() {
float radius = 7.0;
float pi = 3.1416;
float area = pi radius radius;
printf("Area of the circle is: %.2f\n", area);
return 0;
}
include <stdio.h>
int main() {
float principal = 1000, rate = 5, time = 2;
float interest = (principal rate time) / 100;
printf("Simple Interest is: %.2f\n", interest);
return 0;
}
include <stdio.h>
int main() {
float celsius = 25, fahrenheit;
fahrenheit = (celsius 9 / 5) + 32;
printf("%.2f °C is %.2f °F\n", celsius, fahrenheit);
return 0;
}
Selection
include <stdio.h>
int main() {
int num = 10;
if (num > 0)
printf("The number is positive.\n");
return 0;
}
include <stdio.h>
int main() {
int num = -5;
if (num >= 0)
printf("The number is non-negative.\n");
else
printf("The number is negative.\n");
return 0;
}
include <stdio.h>
int main() {
int marks = 75;
if (marks >= 90)
printf("Grade: A\n");
else if (marks >= 75)
printf("Grade: B\n");
else if (marks >= 60)
printf("Grade: C\n");
else
printf("Grade: F\n");
return 0;
}
include <stdio.h>
int main() {
int day = 3;
switch(day) {
case 1:
printf("Sunday\n");
break;
case 2:
printf("Monday\n");
break;
case 3:
printf("Tuesday\n");
break;
default:
printf("Other day\n");
}
return 0;
}
Single lopop
include <stdio.h>
int main() {
int i;
for(i = 1; i <= 10; i++) {
printf("%d ", i);
}
return 0;
}
Ntural
include <stdio.h>
int main() {
int n = 10, sum = 0, i;
for(i = 1; i <= n; i++) {
sum += i;
}
printf("Sum = %d\n", sum);
return 0;
}
Nested
include <stdio.h>
int main() {
int i, j;
for(i = 1; i <= 5; i++) {
for(j = 1; j <= 5; j++) {
printf(" ");
}
printf("\n");
}
return 0;
}
Mtulipclation
include <stdio.h>
int main() {
int i, j;
for(i = 1; i <= 5; i++) {
for(j = 1; j <= 10; j++) {
printf("%d x %d = %d\n", i, j, i j);
}
printf("\n");
}
return 0;
}
Factorial
include <stdio.h>
int main() {
int n, i, fact = 1;
printf("Enter number: ");
scanf("%d", &n);
for(i = 1; i <= n; i++) {
fact = fact i;
}
printf("Factorial = %d", fact);
return 0;
}
Prime
include <stdio.h>
int main() {
int n, i, count = 0;
printf("Enter a number: ");
scanf("%d", &n);
if(n <= 1) {
printf("Neither Prime nor Composite");
} else {
for(i = 1; i <= n; i++) {
if(n % i == 0)
count++;
}
if(count == 2)
printf("Prime number");
else
printf("Composite number");
}
return 0;
}
Palindrome
include <stdio.h>
int main() {
int n, r, rev = 0, temp;
printf("Enter number: ");
scanf("%d", &n);
temp = n;
while(n != 0) {
r = n % 10;
rev = rev 10 + r;
n = n / 10;
}
if(temp == rev)
printf("Palindrome");
else
printf("Not palindrome");
return 0;
}
Fibonacci
include <stdio.h>
int main() {
int n, i, a = 0, b = 1, c;
printf("How many terms? ");
scanf("%d", &n);
printf("%d %d ", a, b);
for(i = 2; i < n; i++) {
c = a + b;
printf("%d ", c);
a = b;
b = c;
}
return 0;
}
Introduction to Web Technology
Web technology refers to the tools, techniques, and languages used to build and
maintain websites and web applications. It includes front-end and back-end
development, database management, web design, and more. It allows users to interact
with content over the internet using browsers.
1) Five Programming Languages & Frameworks Used in Web Development
Languages:
Language:
o HTML (HyperText Markup Language)
o CSS (Cascading Style Sheets)
o JavaScript
o PHP (Hypertext Preprocessor)
o Python
Frameworks:
o react.js
o Angular
o Django
o Laravel
o Node.js
🧩 4) Libraries and Databases Used in Web Development
Libraries:
jQuery
React.js
Bootstrap
D3.js
Chart.js
Databases:
MySQL
MongoDB
PostgreSQL
Firebase
SQLite
---
📚 5) Define CMS with Example (H)
CMS stands for Content Management System, a platform that helps users create and
manage digital content without coding knowledge.
Examples:
WordPress
Joomla
Drupal
---
🌐 6) Discuss About HTML With Its Structure (H)
HTML (HyperText Markup Language) is the standard language used to create webpages.
It uses tags to structure the content.
Basic HTML Structure:
```html
<!DOCTYPE html>
<html>
<head>
<title>My Web Page</title>
</head>
<body>
<h1>Welcome!</h1>
<p>This is a paragraph.</p>
</body>
</html>
```
---
✨ 7) Features of HTML (H)
Easy to learn and use
Platform-independent
Supports multimedia (images, audio, video)
Allows hyperlinking
Supports forms and user input
Integrates with CSS and JavaScript
---
📄 8) HTML Forms + 10 Elements with Syntax (H)
HTML forms collect user input.
Example:
```html
<form action="/submit" method="post">
<input type="text" name="name"><br>
<input type="email" name="email"><br>
</form>
```
10 Form Elements:
Text Field: `<input type="text">`
Password Field: `<input type="password">`
Radio Button: `<input type="radio" name="gender">`
Checkbox: `<input type="checkbox">`
Textarea: `<textarea></textarea>`
Dropdown List: `<select><option>Option</option></select>`
Submit Button: `<input type="submit">`
Reset Button: `<input type="reset">`
Email Field: `<input type="email">`
File Upload: `<input type="file">`
---
9) Types of Tags in HTML (H)
Paired Tags: Need opening and closing tags.
Example: `<p>Paragraph</p>`
Unpaired Tags: Self-closing tags.
Example: `<br>`, `<img>`
---
🧱 10) Layout of HTML (H)
HTML layout divides content using semantic tags:
`<header>` – Top section
`<nav>` – Navigation bar
`<main>` – Main content
`<section>` – Sub-sections
`<article>` – Independent content
`<aside>` – Side content
`<footer>` – Bottom of the page
---
🎨 11) Discuss About CSS With Its Uses (H)
CSS (Cascading Style Sheets) is used to style HTML elements. It controls colors, layouts,
fonts, spacing, and responsiveness of webpages.
Uses:
Improve appearance
Make responsive designs
Keep style separate from structure
---
🧾 12) Types of CSS (H)
Inline CSS: Inside HTML tags
Example: `<p style="color:red;">Text</p>`
Internal CSS: In `<style>` inside `<head>`
```html
<style>
p { color: blue; }
</style>
```
External CSS: In a separate `.css` file
```html
<link rel="stylesheet" href="style.css">
```
---
Let me know if you want this in:
PDF format (colorful, printable) 📄
With diagrams or screenshots
Or converted into slides