C - PROGRAMMING LANGUAGE
SIMPLE NOTES
BY – S.ANTONY ALEX
FOR MORE NOTES CONTACT:
1
, TABLE OF CONTENTS
S.NO TOPICS PG.NO
1 INTRODUCTION TO C PROGRAMMING 3
2 VARIABLES AND DATA TYPES 4
3 FUNCTIONS IN C PROGRAMMING 6
4 OPERATIONS IN C PROGRAMMING 14
5 OPERATORS IN C PROGRAMMING 15
6 VARIABLES IN C PROGRAMMING 22
7 DATA TYPES IN C PROGRAMMING 25
8 MODIFIERS IN C PROGRAMMING 28
9 CONSTANTS IN C PROGRAMMING 30
10 BRANCHING STATEMENTS 34
11 LOOPING STATEMENTS 38
12 LOOP CONTROL STATEMENTS 40
13 JUMP STATEMENTS 43
14 STRINGS IN C PROGRAMMING 46
15 STRING HANDLING 51
16 POINTERS IN C PROGRAMMING 56
17 STRUCTURE AND UNION 61
18 DIFFERENCE B/W STRUCTURE & UNION 66
19 FILES IN C PROGRAMMING 67
20 FILE MANAGEMENT IN C PROGRAMMING 71
2
, C - PROGRAMMING LANGUAGE
C programming is a powerful and versatile programming language that forms the basis for many
other programming languages. Here are some basics to get you started:
Hello World Program:
The classic "Hello, World!" program is a simple way to start learning any programming language.
Example:
#include <stdio.h>
int main() {
printf("Hello, World!\n");
return 0;
}
This program uses the printf function to display the text "Hello, World!" on the console.
Comments:
You can use comments to add explanations to your code. Comments in C begin with /* and end
with */ for multiline comments, or use // for single-line comments.
/* This is a multiline comment */
// This is a single-line comment
3
, Variables and Data Types:
C is a statically typed language, meaning you need to declare the type of a variable before using
it.
Example:
#include <stdio.h>
int main() {
// Variable declaration
int age = 25;
float height = 5.9;
char grade = 'A';
// Display variables
printf("Age: %d\n", age);
printf("Height: %f\n", height);
printf("Grade: %c\n", grade);
return 0;
}
Input and Output:
You can use scanf for input and printf for output.
Example:
#include <stdio.h>
int main() {
4
SIMPLE NOTES
BY – S.ANTONY ALEX
FOR MORE NOTES CONTACT:
1
, TABLE OF CONTENTS
S.NO TOPICS PG.NO
1 INTRODUCTION TO C PROGRAMMING 3
2 VARIABLES AND DATA TYPES 4
3 FUNCTIONS IN C PROGRAMMING 6
4 OPERATIONS IN C PROGRAMMING 14
5 OPERATORS IN C PROGRAMMING 15
6 VARIABLES IN C PROGRAMMING 22
7 DATA TYPES IN C PROGRAMMING 25
8 MODIFIERS IN C PROGRAMMING 28
9 CONSTANTS IN C PROGRAMMING 30
10 BRANCHING STATEMENTS 34
11 LOOPING STATEMENTS 38
12 LOOP CONTROL STATEMENTS 40
13 JUMP STATEMENTS 43
14 STRINGS IN C PROGRAMMING 46
15 STRING HANDLING 51
16 POINTERS IN C PROGRAMMING 56
17 STRUCTURE AND UNION 61
18 DIFFERENCE B/W STRUCTURE & UNION 66
19 FILES IN C PROGRAMMING 67
20 FILE MANAGEMENT IN C PROGRAMMING 71
2
, C - PROGRAMMING LANGUAGE
C programming is a powerful and versatile programming language that forms the basis for many
other programming languages. Here are some basics to get you started:
Hello World Program:
The classic "Hello, World!" program is a simple way to start learning any programming language.
Example:
#include <stdio.h>
int main() {
printf("Hello, World!\n");
return 0;
}
This program uses the printf function to display the text "Hello, World!" on the console.
Comments:
You can use comments to add explanations to your code. Comments in C begin with /* and end
with */ for multiline comments, or use // for single-line comments.
/* This is a multiline comment */
// This is a single-line comment
3
, Variables and Data Types:
C is a statically typed language, meaning you need to declare the type of a variable before using
it.
Example:
#include <stdio.h>
int main() {
// Variable declaration
int age = 25;
float height = 5.9;
char grade = 'A';
// Display variables
printf("Age: %d\n", age);
printf("Height: %f\n", height);
printf("Grade: %c\n", grade);
return 0;
}
Input and Output:
You can use scanf for input and printf for output.
Example:
#include <stdio.h>
int main() {
4