C Programming — Complete Course Notes (BCA 1st Sem)
Comprehensive master notes covering fundamentals, syntax, control statements, arrays, pointers, structures, and file I/O for TU BCA 1st semester.
C Programming · CACS101 · Semester 1
Unit 4•Unit 4 of 6
Unit 4: 3. Data Types and Memory Footprint (32/64-bit Architecture)
| Data Type | Keyword | Size (Bytes) | Format Specifier | Typical Range |
|---|---|---|---|---|
| Character | char | 1 | %c | -128 to 127 |
| Integer | int | 4 | %d | -2,147,483,648 to 2,147,483,647 |
| Floating Point | float | 4 | %f | 1.2E-38 to 3.4E+38 (6 decimals) |
| Double Precision | double | 8 | %lf | 2.3E-308 to 1.7E+308 (15 decimals) |
| Void | void | 0 | - | Valueless |
CS50x Introduction to C Programming Lecture (David J. Malan)
Open lesson pageLesson videos
Related notes
- Unit 1: Introduction to Programming Concepts and C Language NotesNotes
- Unit 2: Operators and Expressions NotesNotes
- Unit 3: Input and Output Operations NotesNotes
- Unit 4: Control Statements and Decision Making NotesNotes
- Unit 5: Arrays and String Manipulations NotesNotes
- Unit 6: Functions and Recursion NotesNotes
Related video lessons
Practice questions
- Which of the following is an invalid variable name in C? (a) _salary (b) 1st_rank (c) total_sum (d) age2objective · 1 marks
- What is the return type of the `malloc()` function in C? (a) `int*` (b) `char*` (c) `void*` (d) `float*`objective · 1 marks
- Explain the difference between call by value and call by reference in C with suitable code snippets.short · 5 marks
- What is recursion? Write a recursive function in C to calculate the factorial of a positive integer.short · 5 marks
- Explain dynamic memory allocation in C. Differentiate between `malloc()` and `calloc()`. Write a C program to dynamically allocate memory for N integers, sort them in ascending order, and free the memory.long · 10 marks
