[go: up one dir, main page]

0% found this document useful (0 votes)
108 views2 pages

C Language Notes

The document provides an overview of the C programming language, including its history, structure, and basic syntax. It covers essential topics such as data types, variables, operators, control statements, loops, arrays, strings, functions, pointers, structures, unions, and file handling. Additionally, it lists important keywords used in C programming.

Uploaded by

monishkumara2008
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
108 views2 pages

C Language Notes

The document provides an overview of the C programming language, including its history, structure, and basic syntax. It covers essential topics such as data types, variables, operators, control statements, loops, arrays, strings, functions, pointers, structures, unions, and file handling. Additionally, it lists important keywords used in C programming.

Uploaded by

monishkumara2008
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

C LANGUAGE NOTES (FROM BASICS)

1. Introduction to C
- Developed by Dennis Ritchie (1972, AT&T; Bell Labs).
- General-purpose, procedural, middle-level language.
- Features: Fast execution, Portable, Structured, Rich operators.
2. Structure of a C Program
#include
int main() {
printf("Hello C");
return 0;
}
3. Basic Syntax
- Case-sensitive, ; ends statements, // comments, /* */ multi-line.
4. Data Types
int, char, float, double, array, pointer, structure, union, void.
5. Variables & Constants
int age = 20; const int PI = 3.14;
6. Operators
Arithmetic (+ - * / %), Relational (== != > <), Logical (&& || !),
Assignment (= +=), Increment (++ --), Bitwise (& | ^ << >>).
7. Input & Output
scanf("%d", #); printf("Value: %d", num);
8. Control Statements
if, else-if, else, switch-case.
9. Loops
for, while, do-while.
10. Arrays
int arr[5] = {1,2,3,4,5};
11. Strings
char name[20] = "C Language";
12. Functions
int add(int a, int b) { return a+b; }
13. Pointers
int *p = &x; printf("%d", *p);
14. Structures & Unions
struct student { int id; char name[20]; };
union data { int i; float f; };
15. File Handling
FILE *fp; fp=fopen("data.txt","w"); fprintf(fp,"Hello"); fclose(fp);
16. Keywords
auto, break, case, char, const, continue, default, do, double, else, enum,
extern, float, for, goto, if, int, long, register, return, short, signed,
sizeof, static, struct, switch, typedef, union, unsigned, void, volatile, while.

You might also like